fix race condition between script execution and saving, closes #4028

This commit is contained in:
zadam 2023-06-15 21:51:41 +02:00
parent 1b68adf3e4
commit 74400dad97

View File

@ -230,6 +230,15 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
}
}
async runActiveNoteCommand(params) {
if (this.isNoteContext(params.ntxId)) {
// make sure that script is saved before running it #4028
await this.spacedUpdate.updateNowIfNecessary();
}
return await this.parent.triggerCommand('runActiveNote', params);
}
async printActiveNoteEvent() {
if (!this.noteContext.isActive()) {
return;