I want the saveAsAndGo()
function to be performed before the callback()
but thats not the case , how can I make sure that it is performed before the callback ?
async saveAndGoTo(): Promise<void> {
Store.setFileChanged(false);
this.fileName = Store.getSelectedFile().name;
if (this.fileName === 'New') {
this.fileNotSavedDialog.hideDialog();
await this.saveAsAndGoTo().then(() => {
this.callback();
});
} else {
this.fileNotSavedDialog.hideDialog();
await this.saveDialog.updateFile().then(() => {
this.callback();
});
}
}
async saveAsAndGoTo(): Promise<void> {
await this.saveDialog.showDialog();
}