From 13a51654e7826e67df7394f294d071bd1b993afe Mon Sep 17 00:00:00 2001 From: Sinharitik589 <67551927+Sinharitik589@users.noreply.github.com> Date: Mon, 4 Apr 2022 12:24:54 +0530 Subject: [PATCH] Spaces selected by default when created (#8085) * Spaces selected by default when created * Spaces selected by default when created * Spaces selected by default when created * Spaces selected by default when created => removed lines intended for room creation * Spaces selected by default when created * Spaces selected by default when created => removed unwanted console log * Spaces selected by default when created => added accidently removed line * Spaces selected by default when created => added accidently removed line * Spaces selected by default when created => linting and brackets added * Update src/stores/spaces/SpaceStore.ts Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Update src/stores/spaces/SpaceStore.ts Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Added missing bracket Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- src/stores/spaces/SpaceStore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stores/spaces/SpaceStore.ts b/src/stores/spaces/SpaceStore.ts index 6e98868712..3360e77c33 100644 --- a/src/stores/spaces/SpaceStore.ts +++ b/src/stores/spaces/SpaceStore.ts @@ -1116,7 +1116,8 @@ export class SpaceStoreClass extends AsyncStoreWithClient { case Action.ViewRoom: { // Don't auto-switch rooms when reacting to a context-switch or for new rooms being created // as this is not helpful and can create loops of rooms/space switching - if (payload.context_switch || payload.justCreatedOpts) break; + const isSpace = payload.justCreatedOpts?.roomType === RoomType.Space; + if (payload.context_switch || (payload.justCreatedOpts && !isSpace)) break; let roomId = payload.room_id; if (payload.room_alias && !roomId) {