diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index a73e62822c..87fbc518c0 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -36,6 +36,7 @@ Item { signal openContactsPopup() function changeAppSection(section) { + appSettings.lastModeActiveCommunity = "" chatsModel.communities.activeCommunity.active = false appView.currentIndex = Utils.getAppSectionIndex(section) } @@ -217,6 +218,7 @@ Item { onClicked: { appMain.changeAppSection(Constants.chat) chatsModel.communities.setActiveCommunity(model.id) + appSettings.lastModeActiveCommunity = model.id } anchors.horizontalCenter: parent.horizontalCenter @@ -406,6 +408,7 @@ Item { if(obj === walletV2LayoutContainer){ walletV2LayoutContainer.showSigningPhrasePopup(); } + appSettings.lastModeActiveTab = (currentIndex === Utils.getAppSectionIndex(Constants.timeline)) ? 0 : currentIndex } ChatLayout { @@ -758,6 +761,12 @@ Item { } } } + + Component.onCompleted: { + appView.currentIndex = appSettings.lastModeActiveTab + if(!!appSettings.lastModeActiveCommunity) + chatsModel.communities.setActiveCommunity(appSettings.lastModeActiveCommunity) + } } /*##^## Designer { diff --git a/ui/main.qml b/ui/main.qml index 8a3ac1020c..c8a6147f4e 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -78,6 +78,8 @@ StatusWindow { property string skinColor: "" property bool showDeleteMessageWarning: true property bool downloadChannelMessagesEnabled: false + property int lastModeActiveTab: 0 + property string lastModeActiveCommunity: "" // Browser settings property bool showBrowserSelector: true