style: remake updateUI into flushUI
This commit is contained in:
@@ -69,8 +69,9 @@ export class PureViewCtrl<P = CtrlProps, S = CtrlState> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateUI(func: () => void) {
|
/** @returns a promise that resolves after the UI has been updated. */
|
||||||
this.$timeout(func);
|
flushUI() {
|
||||||
|
return this.$timeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
initProps(props: CtrlProps) {
|
initProps(props: CtrlProps) {
|
||||||
|
|||||||
@@ -779,12 +779,11 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadTagsString() {
|
async reloadTagsString() {
|
||||||
const tags = this.appState.getNoteTags(this.note);
|
const tags = this.appState.getNoteTags(this.note);
|
||||||
const string = SNTag.arrayToDisplayString(tags);
|
const string = SNTag.arrayToDisplayString(tags);
|
||||||
this.updateUI(() => {
|
await this.flushUI();
|
||||||
this.editorValues.tagsInputValue = string;
|
this.editorValues.tagsInputValue = string;
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private addTag(tag: SNTag) {
|
private addTag(tag: SNTag) {
|
||||||
|
|||||||
Reference in New Issue
Block a user