fix(@desktop/general): Application shows chat screen instead of settings screen when starting.

Fix #5839
This commit is contained in:
Michal Iskierko 2022-05-27 10:49:34 +02:00 committed by Michał Iskierko
parent 49ca3e1c36
commit ec76d8e738
2 changed files with 7 additions and 2 deletions

View File

@ -239,7 +239,8 @@ proc getActiveSectionId*(self: Controller): string =
proc setActiveSection*(self: Controller, sectionId: string) =
self.activeSectionId = sectionId
singletonInstance.localAccountSensitiveSettings.setActiveSection(self.activeSectionId)
let sectionIdToSave = if (sectionId == conf.SETTINGS_SECTION_ID): "" else: sectionId
singletonInstance.localAccountSensitiveSettings.setActiveSection(sectionIdToSave)
self.delegate.activeSectionSet(self.activeSectionId)
proc getNumOfNotificaitonsForChat*(self: Controller): tuple[unviewed:int, mentions:int] =

View File

@ -378,7 +378,11 @@ method load*[T](
#self.communitiesPortalSectionModule.load()
# Set active section on app start
self.setActiveSection(activeSection)
# If section is profile then open chat by default
if activeSection.sectionType == SectionType.ProfileSettings:
self.setActiveSection(self.view.model().getItemBySectionType(SectionType.Chat))
else:
self.setActiveSection(activeSection)
proc checkIfModuleDidLoad [T](self: Module[T]) =
if self.moduleLoaded: