Skip to content

Commit

Permalink
ensure one time initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-411 committed Nov 21, 2024
1 parent 5ce0961 commit bf63c9e
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class PaneController extends AbstractViewController implements InternalEv
currentNavPanelWidth = 0
currentItemsPanelWidth = 0
focusModeEnabled = false
isTabletOrMobile = this._isTabletOrMobileScreen.execute().getValue().isTabletOrMobile
hasPaneInitializationLogicRun = false

listPaneExplicitelyCollapsed = this.preferences.getLocalValue(
LocalPrefKey.ListPaneCollapsed,
Expand Down Expand Up @@ -151,18 +151,22 @@ export class PaneController extends AbstractViewController implements InternalEv
LocalPrefDefaults[LocalPrefKey.NavigationPaneCollapsed],
)

if (this.isTabletOrMobile) {
this.panes = [AppPaneId.Navigation, AppPaneId.Items]
} else {
if (!this.listPaneExplicitelyCollapsed && !this.navigationPaneExplicitelyCollapsed) {
this.panes = [AppPaneId.Navigation, AppPaneId.Items, AppPaneId.Editor]
} else if (this.listPaneExplicitelyCollapsed && this.navigationPaneExplicitelyCollapsed) {
this.panes = [AppPaneId.Editor]
} else if (this.listPaneExplicitelyCollapsed) {
this.panes = [AppPaneId.Navigation, AppPaneId.Editor]
if(!this.hasPaneInitializationLogicRun) {
const screen = this._isTabletOrMobileScreen.execute().getValue()
if (screen.isTabletOrMobile) {
this.panes = [AppPaneId.Navigation, AppPaneId.Items]
} else {
this.panes = [AppPaneId.Items, AppPaneId.Editor]
if (!this.listPaneExplicitelyCollapsed && !this.navigationPaneExplicitelyCollapsed) {
this.panes = [AppPaneId.Navigation, AppPaneId.Items, AppPaneId.Editor]
} else if (this.listPaneExplicitelyCollapsed && this.navigationPaneExplicitelyCollapsed) {
this.panes = [AppPaneId.Editor]
} else if (this.listPaneExplicitelyCollapsed) {
this.panes = [AppPaneId.Navigation, AppPaneId.Editor]
} else {
this.panes = [AppPaneId.Items, AppPaneId.Editor]
}
}
this.hasPaneInitializationLogicRun = true
}
}
}
Expand Down

0 comments on commit bf63c9e

Please sign in to comment.