Make RoomListStore aware of sub list orderings

so that it can do optimistic updates of ordered lists.
This commit is contained in:
lukebarnard 2018-02-06 15:15:47 +00:00 committed by Luke Barnard
parent 21d70125e4
commit 9b0df19149
2 changed files with 103 additions and 75 deletions

View file

@ -116,8 +116,9 @@ RoomListActions.tagRoom = function(matrixClient, room, oldTag, newTag, oldIndex,
if (newTag && newTag !== 'im.vector.fake.direct' &&
(hasChangedSubLists || metaData)
) {
// Optimistic update of what will happen to the room tags
room.tags[newTag] = metaData || {};
// metaData is the body of the PUT to set the tag, so it must
// at least be an empty object.
metaData = metaData || {};
const promiseToAdd = matrixClient.setRoomTag(roomId, newTag, metaData).catch(function(err) {
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");