mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 08:46:43 +01:00
script can wait until the sync data has been applied
This commit is contained in:
@@ -9,6 +9,7 @@ import noteTooltipService from './note_tooltip.js';
|
||||
import protectedSessionService from './protected_session.js';
|
||||
import dateNotesService from './date_notes.js';
|
||||
import StandardWidget from '../widgets/standard_widget.js';
|
||||
import ws from "./ws.js";
|
||||
|
||||
/**
|
||||
* This is the main frontend API interface for scripts. It's published in the local "api" object.
|
||||
@@ -147,6 +148,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
});
|
||||
|
||||
if (ret.success) {
|
||||
// wait until all the changes done in the script has been synced to frontend before continuing
|
||||
await ws.waitForSyncId(ret.maxSyncId);
|
||||
|
||||
return ret.executionResult;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user