From b92ac455c9669d3b953c48f5483b399dae60a6b6 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Mon, 6 Dec 2021 11:46:13 +0100 Subject: [PATCH] fix: ensure last active community is reset when leaving community There's a bug where the last active community will be set in local settings and not removed when a user leaves a community. This causes the app to start on an invalid screen/state as it still tries to render the community view for a community that the user has just left. This commit ensure we're resetting the last active community in the local settings when a users leaves the community. Fixes: #4094 --- ui/app/AppLayouts/Chat/stores/RootStore.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index 257939dbc8..f4749b1b89 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -136,6 +136,9 @@ QtObject { function leaveCommunity(communityId) { chatsModelInst.communities.leaveCommunity(communityId); + if (communityId == chatsModelInst.communities.activeCommunity.id) { + localAccountSensitiveSettings.lastModeActiveCommunity = "" + } } function setCommunityMuted(communityId, checked) {