File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,12 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
181181 const room = this . matrixClient . getRoom ( roomId ) ;
182182 const tryUpdate = async ( updatedRoom : Room ) => {
183183 console . log ( `[RoomListDebug] Live timeline event ${ eventPayload . event . getId ( ) } in ${ updatedRoom . roomId } ` ) ;
184+ if ( eventPayload . event . getType ( ) === 'm.room.tombstone' && eventPayload . event . getStateKey ( ) === '' ) {
185+ console . log ( `[RoomListDebug] Got tombstone event - regenerating room list` ) ;
186+ // TODO: We could probably be smarter about this
187+ await this . regenerateAllLists ( ) ;
188+ return ; // don't pass the update down - we will have already handled it in the regen
189+ }
184190 await this . handleRoomUpdate ( updatedRoom , RoomUpdateCause . Timeline ) ;
185191 } ;
186192 if ( ! room ) {
@@ -334,7 +340,7 @@ export class RoomListStore2 extends AsyncStore<ActionPayload> {
334340 }
335341
336342 await this . algorithm . populateTags ( sorts , orders ) ;
337- await this . algorithm . setKnownRooms ( this . matrixClient . getRooms ( ) ) ;
343+ await this . algorithm . setKnownRooms ( this . matrixClient . getVisibleRooms ( ) ) ;
338344
339345 this . initialListsGenerated = true ;
340346
You can’t perform that action at this time.
0 commit comments