diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 519724b4f..f62316d17 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -2bf2ac012f4e7616c95ee0f58edbde23 \ No newline at end of file +9d5105d4c4a3b343276bbd9fb40da225 \ No newline at end of file diff --git a/lib/store/rooms/actions.dart b/lib/store/rooms/actions.dart index 27583e7f9..5f0d73376 100644 --- a/lib/store/rooms/actions.dart +++ b/lib/store/rooms/actions.dart @@ -149,14 +149,6 @@ ThunkAction syncRooms(Map roomData) { '[syncRooms] ${room.name} ids msg count ${room.messageIds.length}', ); - // update store - await store.dispatch( - setUsers(room.usersNew), - ); - await store.dispatch( - setMessageEvents(room: room, messages: room.messagesNew), - ); - // update cold storage await Future.wait([ saveUsers(room.usersNew, storage: Storage.main), @@ -164,12 +156,23 @@ ThunkAction syncRooms(Map roomData) { saveMessages(room.messagesNew, storage: Storage.main), ]); + // update store + await store.dispatch( + setUsers(room.usersNew), + ); + store.dispatch( + setMessageEvents(room: room, messages: room.messagesNew), + ); + // TODO: remove with parsers - clear users from parsed room objects room = room.copyWith( users: Map(), messagesNew: List(), ); + // update room + store.dispatch(SetRoom(room: room)); + // fetch avatar if a uri was found if (room.avatarUri != null) { store.dispatch(fetchThumbnail( @@ -188,9 +191,6 @@ ThunkAction syncRooms(Map roomData) { from: room.prevHash, )); } - - // update room - store.dispatch(SetRoom(room: room)); }); }; }