From d68afcc4ce278d89d9b9bff0dc0ca7490445a627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 26 Mar 2021 13:52:41 +0100 Subject: [PATCH] Use else if MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Maybe it looks a little nicer, I don't know Signed-off-by: Šimon Brandner --- src/stores/SpaceStore.tsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/stores/SpaceStore.tsx b/src/stores/SpaceStore.tsx index 2eec2afbb3..1bf98617a3 100644 --- a/src/stores/SpaceStore.tsx +++ b/src/stores/SpaceStore.tsx @@ -123,17 +123,15 @@ export class SpaceStoreClass extends AsyncStoreWithClient { action: "view_room", room_id: roomId, }); + } else if (space) { + defaultDispatcher.dispatch({ + action: "view_room", + room_id: space.roomId, + }); } else { - if (space) { - defaultDispatcher.dispatch({ - action: "view_room", - room_id: space.roomId, - }); - } else { - defaultDispatcher.dispatch({ - action: "view_home_page", - }); - } + defaultDispatcher.dispatch({ + action: "view_home_page", + }); } // persist space selected