fix(@desktop/chat): Remember the last tab (in nav bar) opened when status app is reopened
With this fix after a restart the tab which the user was last one (chat, community, wallet, browser, settings) will be the active one. If the user was on the timeline tab when the app is closed, the app will be launched with the chat tab. fixes #3559
This commit is contained in:
parent
38a1528598
commit
6e3ac7d5dc
|
@ -36,6 +36,7 @@ Item {
|
||||||
signal openContactsPopup()
|
signal openContactsPopup()
|
||||||
|
|
||||||
function changeAppSection(section) {
|
function changeAppSection(section) {
|
||||||
|
appSettings.lastModeActiveCommunity = ""
|
||||||
chatsModel.communities.activeCommunity.active = false
|
chatsModel.communities.activeCommunity.active = false
|
||||||
appView.currentIndex = Utils.getAppSectionIndex(section)
|
appView.currentIndex = Utils.getAppSectionIndex(section)
|
||||||
}
|
}
|
||||||
|
@ -217,6 +218,7 @@ Item {
|
||||||
onClicked: {
|
onClicked: {
|
||||||
appMain.changeAppSection(Constants.chat)
|
appMain.changeAppSection(Constants.chat)
|
||||||
chatsModel.communities.setActiveCommunity(model.id)
|
chatsModel.communities.setActiveCommunity(model.id)
|
||||||
|
appSettings.lastModeActiveCommunity = model.id
|
||||||
}
|
}
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
@ -406,6 +408,7 @@ Item {
|
||||||
if(obj === walletV2LayoutContainer){
|
if(obj === walletV2LayoutContainer){
|
||||||
walletV2LayoutContainer.showSigningPhrasePopup();
|
walletV2LayoutContainer.showSigningPhrasePopup();
|
||||||
}
|
}
|
||||||
|
appSettings.lastModeActiveTab = (currentIndex === Utils.getAppSectionIndex(Constants.timeline)) ? 0 : currentIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatLayout {
|
ChatLayout {
|
||||||
|
@ -758,6 +761,12 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
appView.currentIndex = appSettings.lastModeActiveTab
|
||||||
|
if(!!appSettings.lastModeActiveCommunity)
|
||||||
|
chatsModel.communities.setActiveCommunity(appSettings.lastModeActiveCommunity)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*##^##
|
/*##^##
|
||||||
Designer {
|
Designer {
|
||||||
|
|
|
@ -78,6 +78,8 @@ StatusWindow {
|
||||||
property string skinColor: ""
|
property string skinColor: ""
|
||||||
property bool showDeleteMessageWarning: true
|
property bool showDeleteMessageWarning: true
|
||||||
property bool downloadChannelMessagesEnabled: false
|
property bool downloadChannelMessagesEnabled: false
|
||||||
|
property int lastModeActiveTab: 0
|
||||||
|
property string lastModeActiveCommunity: ""
|
||||||
|
|
||||||
// Browser settings
|
// Browser settings
|
||||||
property bool showBrowserSelector: true
|
property bool showBrowserSelector: true
|
||||||
|
|
Loading…
Reference in New Issue