From 27f8c33dbdf782e5827a47a5fe06b7508ae420ff Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Mon, 6 Dec 2021 14:34:53 +0100 Subject: [PATCH] fix: ensure app sections work correctly We've recently removed timeline related code from the application. It seems that either a) new changes have been introduced related to timeline despite it being removed from the application, or b) a few more changes where left out as part of the new architecture. This causes the app to misbehave when selecting sections in the application nav bar. This commit fixes this by removing leftover timeline related code. --- src/app/global/app_sections_config.nim | 4 ---- src/app/modules/main/item.nim | 1 - src/app/modules/main/module.nim | 8 -------- ui/app/AppMain.qml | 26 -------------------------- ui/imports/utils/Constants.qml | 12 +++++------- ui/main.qml | 2 -- 6 files changed, 5 insertions(+), 48 deletions(-) diff --git a/src/app/global/app_sections_config.nim b/src/app/global/app_sections_config.nim index 6d51f6b8d4..80e1f940f9 100644 --- a/src/app/global/app_sections_config.nim +++ b/src/app/global/app_sections_config.nim @@ -14,10 +14,6 @@ const BROWSER_SECTION_ID* = "browser" const BROWSER_SECTION_NAME* = "Browser" const BROWSER_SECTION_ICON* = "browser" -const TIMELINE_SECTION_ID* = "timeline" -const TIMELINE_SECTION_NAME* = "Timeline" -const TIMELINE_SECTION_ICON* = "status-update" - const NODEMANAGEMENT_SECTION_ID* = "nodeManagement" const NODEMANAGEMENT_SECTION_NAME* = "Node Management" const NODEMANAGEMENT_SECTION_ICON* = "node" diff --git a/src/app/modules/main/item.nim b/src/app/modules/main/item.nim index 7641cd9e6b..16e077f3ae 100644 --- a/src/app/modules/main/item.nim +++ b/src/app/modules/main/item.nim @@ -7,7 +7,6 @@ type Wallet, WalletV2, Browser, - Timeline, ProfileSettings, NodeManagement diff --git a/src/app/modules/main/module.nim b/src/app/modules/main/module.nim index d67b34237d..ae9bd3d6a4 100644 --- a/src/app/modules/main/module.nim +++ b/src/app/modules/main/module.nim @@ -187,14 +187,6 @@ method load*[T]( if(activeSectionId == browserSectionItem.id): activeSection = browserSectionItem - # Timeline Section - let timelineSectionItem = initItem(conf.TIMELINE_SECTION_ID, SectionType.Timeline, conf.TIMELINE_SECTION_NAME, "", - conf.TIMELINE_SECTION_ICON, "", false, 0, - false, singletonInstance.localAccountSensitiveSettings.getTimelineEnabled()) - self.view.addItem(timelineSectionItem) - if(activeSectionId == timelineSectionItem.id): - activeSection = timelineSectionItem - # Node Management Section let nodeManagementSectionItem = initItem(conf.NODEMANAGEMENT_SECTION_ID, SectionType.NodeManagement, conf.NODEMANAGEMENT_SECTION_NAME, "", conf.NODEMANAGEMENT_SECTION_ICON, "", false, 0, false, diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 316f450f02..65d61ea79c 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -10,7 +10,6 @@ import shared.panels 1.0 import shared.popups 1.0 import shared.status 1.0 import "./AppLayouts" -import "./AppLayouts/Timeline" import "./AppLayouts/Wallet" import "./AppLayouts/WalletV2" import "./AppLayouts/Chat/popups" @@ -374,9 +373,6 @@ Item { else if(mainModule.activeSection.sectionType === Constants.appSection.browser) { return Constants.appViewStackIndex.browser } - else if(mainModule.activeSection.sectionType === Constants.appSection.timeline) { - return Constants.appViewStackIndex.timeline - } else if(mainModule.activeSection.sectionType === Constants.appSection.profile) { return Constants.appViewStackIndex.profile } @@ -401,10 +397,6 @@ Item { browserLayoutContainer.active = true; } - if(obj === timelineLayoutContainer){ - timelineLayoutContainer.active = true - } - if(obj === walletLayoutContainer){ walletLayoutContainer.showSigningPhrasePopup(); } @@ -469,24 +461,6 @@ Item { property var _web3Provider: web3Provider } - Loader { - id: timelineLayoutContainer - sourceComponent: Component { - TimelineLayout { - messageStore: appMain.rootStore.messageStore - rootStore: appMain.rootStore - Component.onCompleted: { - chatCommunitySectionModule = mainModule.getChatSectionModule() - } - } - } - onLoaded: timelineLayoutContainer.item.onActivated() - active: false - Layout.fillWidth: true - Layout.alignment: Qt.AlignLeft | Qt.AlignTop - Layout.fillHeight: true - } - ProfileLayout { id: profileLayoutContainer Layout.fillWidth: true diff --git a/ui/imports/utils/Constants.qml b/ui/imports/utils/Constants.qml index c6a1a600c1..f1ab6eb005 100644 --- a/ui/imports/utils/Constants.qml +++ b/ui/imports/utils/Constants.qml @@ -15,20 +15,18 @@ QtObject { readonly property int wallet: 2 readonly property int walletv2: 3 readonly property int browser: 4 - readonly property int timeline: 5 - readonly property int profile: 6 - readonly property int node: 7 + readonly property int profile: 5 + readonly property int node: 6 } readonly property QtObject appViewStackIndex: QtObject { readonly property int chat: 0 readonly property int community: 7 // any stack layout children with the index 7 or higher is community readonly property int wallet: 1 - readonly property int walletv2: 6 + readonly property int walletv2: 5 readonly property int browser: 2 - readonly property int timeline: 3 - readonly property int profile: 4 - readonly property int node: 5 + readonly property int profile: 3 + readonly property int node: 4 } readonly property QtObject osNotificationType: QtObject{ diff --git a/ui/main.qml b/ui/main.qml index 48259a901e..50371d6191 100644 --- a/ui/main.qml +++ b/ui/main.qml @@ -434,8 +434,6 @@ StatusWindow { // chatsModel.channelView.activeChannel.chatType === Constants.chatType.privateGroupChat // ) // ) || -// // in timeline view -// loader.item.appLayout.appView.currentIndex === Constants.appViewStackIndex.timeline || // // In community section // chatsModel.communities.activeCommunity.active // )