fix: issue when creating new note in new tag doesnt re-render immediately
This commit is contained in:
@@ -333,9 +333,14 @@ export class NotesViewState {
|
|||||||
if (this.isFiltering) {
|
if (this.isFiltering) {
|
||||||
title = this.noteFilterText;
|
title = this.noteFilterText;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.appState.openNewNote(title);
|
await this.appState.openNewNote(title);
|
||||||
this.reloadNotes();
|
this.application.performFunctionWithAngularDigestCycleAfterAsyncChange(
|
||||||
this.appState.noteTags.reloadTags();
|
() => {
|
||||||
|
this.reloadNotes();
|
||||||
|
this.appState.noteTags.reloadTags();
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
createPlaceholderNote = () => {
|
createPlaceholderNote = () => {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export class WebApplication extends SNApplication {
|
|||||||
platform: Platform,
|
platform: Platform,
|
||||||
identifier: string,
|
identifier: string,
|
||||||
private $compile: angular.ICompileService,
|
private $compile: angular.ICompileService,
|
||||||
|
private $timeout: angular.ITimeoutService,
|
||||||
scope: angular.IScope,
|
scope: angular.IScope,
|
||||||
defaultSyncServerHost: string,
|
defaultSyncServerHost: string,
|
||||||
public bridge: Bridge,
|
public bridge: Bridge,
|
||||||
@@ -104,6 +105,16 @@ export class WebApplication extends SNApplication {
|
|||||||
this.webServices = services;
|
this.webServices = services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a UI change is made in an async function, Angular might not re-render the change.
|
||||||
|
* Use this function to force re-render the UI after an async function has made UI changes.
|
||||||
|
*/
|
||||||
|
public performFunctionWithAngularDigestCycleAfterAsyncChange(
|
||||||
|
func: () => void
|
||||||
|
) {
|
||||||
|
this.$timeout(func);
|
||||||
|
}
|
||||||
|
|
||||||
public getAppState(): AppState {
|
public getAppState(): AppState {
|
||||||
return this.webServices.appState;
|
return this.webServices.appState;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ export class ApplicationGroup extends SNApplicationGroup {
|
|||||||
platform,
|
platform,
|
||||||
descriptor.identifier,
|
descriptor.identifier,
|
||||||
this.$compile,
|
this.$compile,
|
||||||
|
this.$timeout,
|
||||||
scope,
|
scope,
|
||||||
this.defaultSyncServerHost,
|
this.defaultSyncServerHost,
|
||||||
this.bridge,
|
this.bridge,
|
||||||
|
|||||||
Reference in New Issue
Block a user