refactor: rename state
This commit is contained in:
@@ -16,7 +16,7 @@ import { Bridge } from '@/services/bridge';
|
||||
import { storage, StorageKey } from '@/services/localStorage';
|
||||
import { AccountMenuState } from './account_menu_state';
|
||||
import { ActionsMenuState } from './actions_menu_state';
|
||||
import { ActiveNoteState } from './active_note_state';
|
||||
import { NoteTagsState } from './note_tags_state';
|
||||
import { NoAccountWarningState } from './no_account_warning_state';
|
||||
import { SyncState } from './sync_state';
|
||||
import { SearchOptionsState } from './search_options_state';
|
||||
@@ -63,8 +63,8 @@ export class AppState {
|
||||
showBetaWarning: boolean;
|
||||
readonly accountMenu = new AccountMenuState();
|
||||
readonly actionsMenu = new ActionsMenuState();
|
||||
readonly activeNote: ActiveNoteState;
|
||||
readonly noAccountWarning: NoAccountWarningState;
|
||||
readonly noteTags: NoteTagsState;
|
||||
readonly sync = new SyncState();
|
||||
readonly searchOptions: SearchOptionsState;
|
||||
readonly notes: NotesState;
|
||||
@@ -83,11 +83,6 @@ export class AppState {
|
||||
this.$timeout = $timeout;
|
||||
this.$rootScope = $rootScope;
|
||||
this.application = application;
|
||||
this.activeNote = new ActiveNoteState(
|
||||
application,
|
||||
this,
|
||||
this.appEventObserverRemovers
|
||||
);
|
||||
this.notes = new NotesState(
|
||||
application,
|
||||
this,
|
||||
@@ -96,6 +91,11 @@ export class AppState {
|
||||
},
|
||||
this.appEventObserverRemovers,
|
||||
);
|
||||
this.noteTags = new NoteTagsState(
|
||||
application,
|
||||
this,
|
||||
this.appEventObserverRemovers
|
||||
);
|
||||
this.tags = new TagsState(
|
||||
application,
|
||||
this.appEventObserverRemovers,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { action, computed, makeObservable, observable } from 'mobx';
|
||||
import { WebApplication } from '../application';
|
||||
import { AppState } from './app_state';
|
||||
|
||||
export class ActiveNoteState {
|
||||
export class NoteTagsState {
|
||||
autocompleteSearchQuery = '';
|
||||
autocompleteTagResultElements: (HTMLButtonElement | undefined)[] = [];
|
||||
autocompleteTagResults: SNTag[] = [];
|
||||
@@ -171,7 +171,7 @@ export class NotesState {
|
||||
this.activeEditor.setNote(note);
|
||||
}
|
||||
|
||||
this.appState.activeNote.reloadTags();
|
||||
this.appState.noteTags.reloadTags();
|
||||
await this.onActiveEditorChanged();
|
||||
|
||||
if (note.waitingForKey) {
|
||||
|
||||
Reference in New Issue
Block a user