diff --git a/app/assets/javascripts/ui_models/app_state/features_state.ts b/app/assets/javascripts/ui_models/app_state/features_state.ts index 9977041b574..810a6121f5d 100644 --- a/app/assets/javascripts/ui_models/app_state/features_state.ts +++ b/app/assets/javascripts/ui_models/app_state/features_state.ts @@ -28,11 +28,18 @@ export class FeaturesState { enableNativeFoldersFeature: computed, }); - this.unsub = this.application.addEventObserver(async () => { - runInAction(() => { - this._hasFolders = this.hasNativeFolders(); - }); - }, ApplicationEvent.FeaturesUpdated); + this.unsub = this.application.addEventObserver(async (eventName) => { + switch (eventName) { + case ApplicationEvent.FeaturesUpdated: + case ApplicationEvent.Launched: + runInAction(() => { + this._hasFolders = this.hasNativeFolders(); + }); + break; + default: + break; + } + }); } public deinit() { diff --git a/app/assets/javascripts/views/application/application-view.pug b/app/assets/javascripts/views/application/application-view.pug index 785ce2df5b5..4783b1a5b7e 100644 --- a/app/assets/javascripts/views/application/application-view.pug +++ b/app/assets/javascripts/views/application/application-view.pug @@ -3,14 +3,14 @@ ) #app.app( ng-class='self.state.appClass', - ng-if='!self.state.needsUnlock && self.state.ready' + ng-if='!self.state.needsUnlock && self.state.launched' ) tags-view(application='self.application') notes-view(application='self.application') editor-group-view.flex-grow(application='self.application') footer-view( - ng-if='!self.state.needsUnlock && self.state.ready' + ng-if='!self.state.needsUnlock && self.state.launched' application='self.application' ) diff --git a/app/assets/javascripts/views/application/application_view.ts b/app/assets/javascripts/views/application/application_view.ts index 104e668288f..a946ca20a28 100644 --- a/app/assets/javascripts/views/application/application_view.ts +++ b/app/assets/javascripts/views/application/application_view.ts @@ -3,22 +3,25 @@ import { WebDirective } from '@/types'; import { getPlatformString } from '@/utils'; import template from './application-view.pug'; import { AppStateEvent, PanelResizedData } from '@/ui_models/app_state'; -import { ApplicationEvent, Challenge, removeFromArray } from '@standardnotes/snjs'; import { - PANEL_NAME_NOTES, - PANEL_NAME_TAGS -} from '@/views/constants'; -import { - STRING_DEFAULT_FILE_ERROR -} from '@/strings'; + ApplicationEvent, + Challenge, + removeFromArray, +} from '@standardnotes/snjs'; +import { PANEL_NAME_NOTES, PANEL_NAME_TAGS } from '@/views/constants'; +import { STRING_DEFAULT_FILE_ERROR } from '@/strings'; import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl'; import { alertDialog } from '@/services/alertService'; -class ApplicationViewCtrl extends PureViewCtrl { +class ApplicationViewCtrl extends PureViewCtrl< + unknown, + { + started?: boolean; + launched?: boolean; + needsUnlock?: boolean; + appClass: string; + } +> { public platformString: string; private notesCollapsed = false; private tagsCollapsed = false; @@ -76,7 +79,7 @@ class ApplicationViewCtrl extends PureViewCtrl { this.challenges.push(challenge); }); - } + }, }); await this.application.launch(); } @@ -90,14 +93,17 @@ class ApplicationViewCtrl extends PureViewCtrl