fix: reload note counts (#797)
* fix: reload note counts * fix: select smart tags on load
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { WebApplication } from '@/ui_models/application';
|
|
||||||
import { AppState } from '@/ui_models/app_state';
|
import { AppState } from '@/ui_models/app_state';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { FunctionComponent } from 'preact';
|
import { FunctionComponent } from 'preact';
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { confirmDialog } from '@/services/alertService';
|
import { confirmDialog } from '@/services/alertService';
|
||||||
import { STRING_DELETE_TAG, STRING_MISSING_SYSTEM_TAG } from '@/strings';
|
import { STRING_DELETE_TAG, STRING_MISSING_SYSTEM_TAG } from '@/strings';
|
||||||
import {
|
import {
|
||||||
|
ApplicationEvent,
|
||||||
ComponentAction,
|
ComponentAction,
|
||||||
ContentType,
|
ContentType,
|
||||||
MessageData,
|
MessageData,
|
||||||
@@ -8,7 +9,7 @@ import {
|
|||||||
SNSmartTag,
|
SNSmartTag,
|
||||||
SNTag,
|
SNTag,
|
||||||
TagMutator,
|
TagMutator,
|
||||||
UuidString
|
UuidString,
|
||||||
} from '@standardnotes/snjs';
|
} from '@standardnotes/snjs';
|
||||||
import {
|
import {
|
||||||
action,
|
action,
|
||||||
@@ -16,7 +17,7 @@ import {
|
|||||||
makeAutoObservable,
|
makeAutoObservable,
|
||||||
makeObservable,
|
makeObservable,
|
||||||
observable,
|
observable,
|
||||||
runInAction
|
runInAction,
|
||||||
} from 'mobx';
|
} from 'mobx';
|
||||||
import { WebApplication } from '../application';
|
import { WebApplication } from '../application';
|
||||||
import { FeaturesState, SMART_TAGS_FEATURE_NAME } from './features_state';
|
import { FeaturesState, SMART_TAGS_FEATURE_NAME } from './features_state';
|
||||||
@@ -87,6 +88,7 @@ export class TagsState {
|
|||||||
this.editing_ = undefined;
|
this.editing_ = undefined;
|
||||||
|
|
||||||
this.smartTags = this.application.getSmartTags();
|
this.smartTags = this.application.getSmartTags();
|
||||||
|
this.selected_ = this.smartTags[0];
|
||||||
|
|
||||||
makeObservable(this, {
|
makeObservable(this, {
|
||||||
tags: observable.ref,
|
tags: observable.ref,
|
||||||
@@ -146,6 +148,18 @@ export class TagsState {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
appEventListeners.push(
|
||||||
|
this.application.addEventObserver(async (eventName) => {
|
||||||
|
switch (eventName) {
|
||||||
|
case ApplicationEvent.CompletedIncrementalSync:
|
||||||
|
runInAction(() => {
|
||||||
|
this.allNotesCount_ = this.countAllNotes();
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get allLocalRootTags(): SNTag[] {
|
public get allLocalRootTags(): SNTag[] {
|
||||||
|
|||||||
Reference in New Issue
Block a user