mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-18 17:53:42 -05:00
web/statestore: reload room view if state store is cleared
This commit is contained in:
parent
3f4333003d
commit
7f80301276
1 changed files with 6 additions and 0 deletions
|
@ -256,8 +256,10 @@ export class StateStore {
|
|||
}
|
||||
|
||||
applySync(sync: SyncCompleteData) {
|
||||
let prevActiveRoom: RoomID | null = null
|
||||
if (sync.clear_state && this.rooms.size > 0) {
|
||||
console.info("Clearing state store as sync told to reset and there are rooms in the store")
|
||||
prevActiveRoom = this.activeRoomID
|
||||
this.clear()
|
||||
}
|
||||
const resyncRoomList = this.roomList.current.length === 0
|
||||
|
@ -388,6 +390,10 @@ export class StateStore {
|
|||
this.topLevelSpaces.emit(sync.top_level_spaces)
|
||||
this.spaceOrphans.children = sync.top_level_spaces.map(child_id => ({ child_id }))
|
||||
}
|
||||
if (prevActiveRoom) {
|
||||
// TODO this will fail if the room is not in the top 100 recent rooms
|
||||
this.switchRoom?.(prevActiveRoom)
|
||||
}
|
||||
}
|
||||
|
||||
invalidateEmojiPackKeyCache() {
|
||||
|
|
Loading…
Add table
Reference in a new issue