style: remake updateUI into flushUI

This commit is contained in:
Baptiste Grob
2020-08-18 18:14:24 +02:00
parent 2609cb07b7
commit 5c7bc32306
2 changed files with 6 additions and 6 deletions

View File

@@ -69,8 +69,9 @@ export class PureViewCtrl<P = CtrlProps, S = CtrlState> {
});
}
async updateUI(func: () => void) {
this.$timeout(func);
/** @returns a promise that resolves after the UI has been updated. */
flushUI() {
return this.$timeout();
}
initProps(props: CtrlProps) {

View File

@@ -779,12 +779,11 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
);
}
reloadTagsString() {
async reloadTagsString() {
const tags = this.appState.getNoteTags(this.note);
const string = SNTag.arrayToDisplayString(tags);
this.updateUI(() => {
this.editorValues.tagsInputValue = string;
})
await this.flushUI();
this.editorValues.tagsInputValue = string;
}
private addTag(tag: SNTag) {