diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.html index 9b6acb3a0..491a86100 100644 --- a/docs/backend_api/entities_note.js.html +++ b/docs/backend_api/entities_note.js.html @@ -553,7 +553,7 @@ class Note extends Entity { const attributes = await this.loadOwnedAttributesToCache(); for (const attribute of attributes) { - if (attribute.type === type && (value === undefined || value === attribute.value)) { + if (attribute.type === type && attribute.name === name && (value === undefined || value === attribute.value)) { attribute.isDeleted = true; await attribute.save(); diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html index 8c76aa124..673fb043a 100644 --- a/docs/backend_api/services_backend_script_api.js.html +++ b/docs/backend_api/services_backend_script_api.js.html @@ -232,7 +232,7 @@ function BackendScriptApi(currentNote, apiParams) { this.createDataNote = async (parentNoteId, title, content = {}) => await noteService.createNewNote({ parentNoteId, title, - content: JSON.stringify(content), + content: JSON.stringify(content, null, '\t'), type: 'code', mime: 'application/json' }); diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index bcb2edccb..4197e7611 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -807,7 +807,7 @@
- Activates newly created note. Compared to this.activateNote() also refreshes tree. + Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced.
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index d45ca3336..460941ea9 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -86,13 +86,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte }; /** - * Activates newly created note. Compared to this.activateNote() also refreshes tree. + * Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced. * * @param {string} notePath (or noteId) * @return {Promise<void>} */ this.activateNewNote = async notePath => { - await treeService.reload(); + await ws.waitForMaxKnownSyncId(); await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle); }; diff --git a/src/public/javascripts/services/frontend_script_api.js b/src/public/javascripts/services/frontend_script_api.js index 06bc5e839..a141c8f19 100644 --- a/src/public/javascripts/services/frontend_script_api.js +++ b/src/public/javascripts/services/frontend_script_api.js @@ -58,13 +58,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte }; /** - * Activates newly created note. Compared to this.activateNote() also refreshes tree. + * Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced. * * @param {string} notePath (or noteId) * @return {Promise} */ this.activateNewNote = async notePath => { - await treeService.reload(); + await ws.waitForMaxKnownSyncId(); await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle); };