This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -535,7 +535,7 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
535535 // Don't context switch when navigating to the space room
536536 // as it will cause you to end up in the wrong room
537537 this . setActiveSpace ( room , false ) ;
538- } else if ( ! this . getSpaceFilteredRoomIds ( this . activeSpace ) . has ( roomId ) ) {
538+ } else if ( this . activeSpace && ! this . getSpaceFilteredRoomIds ( this . activeSpace ) . has ( roomId ) ) {
539539 this . switchToRelatedSpace ( roomId ) ;
540540 }
541541
Original file line number Diff line number Diff line change @@ -641,14 +641,14 @@ describe("SpaceStore", () => {
641641
642642 it ( "switch to canonical parent space for room" , async ( ) => {
643643 viewRoom ( room1 ) ;
644- await store . setActiveSpace ( null , false ) ;
644+ await store . setActiveSpace ( client . getRoom ( space2 ) , false ) ;
645645 viewRoom ( room2 ) ;
646646 expect ( store . activeSpace ) . toBe ( client . getRoom ( space2 ) ) ;
647647 } ) ;
648648
649649 it ( "switch to first containing space for room" , async ( ) => {
650650 viewRoom ( room2 ) ;
651- await store . setActiveSpace ( null , false ) ;
651+ await store . setActiveSpace ( client . getRoom ( space2 ) , false ) ;
652652 viewRoom ( room1 ) ;
653653 expect ( store . activeSpace ) . toBe ( client . getRoom ( space1 ) ) ;
654654 } ) ;
@@ -659,6 +659,13 @@ describe("SpaceStore", () => {
659659 viewRoom ( orphan1 ) ;
660660 expect ( store . activeSpace ) . toBeNull ( ) ;
661661 } ) ;
662+
663+ it ( "when switching rooms in the all rooms home space don't switch to related space" , async ( ) => {
664+ viewRoom ( room2 ) ;
665+ await store . setActiveSpace ( null , false ) ;
666+ viewRoom ( room1 ) ;
667+ expect ( store . activeSpace ) . toBeNull ( ) ;
668+ } ) ;
662669 } ) ;
663670
664671 describe ( "traverseSpace" , ( ) => {
You can’t perform that action at this time.
0 commit comments