activateNewNote does not reload whole tree anymore

This commit is contained in:
zadam 2020-01-04 21:53:49 +01:00
parent acb76e0630
commit 2150619d62
5 changed files with 7 additions and 7 deletions

View File

@ -553,7 +553,7 @@ class Note extends Entity {
const attributes = await this.loadOwnedAttributesToCache(); const attributes = await this.loadOwnedAttributesToCache();
for (const attribute of attributes) { 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; attribute.isDeleted = true;
await attribute.save(); await attribute.save();

View File

@ -232,7 +232,7 @@ function BackendScriptApi(currentNote, apiParams) {
this.createDataNote = async (parentNoteId, title, content = {}) => await noteService.createNewNote({ this.createDataNote = async (parentNoteId, title, content = {}) => await noteService.createNewNote({
parentNoteId, parentNoteId,
title, title,
content: JSON.stringify(content), content: JSON.stringify(content, null, '\t'),
type: 'code', type: 'code',
mime: 'application/json' mime: 'application/json'
}); });

View File

@ -807,7 +807,7 @@
<div class="description"> <div class="description">
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.
</div> </div>

View File

@ -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) * @param {string} notePath (or noteId)
* @return {Promise&lt;void>} * @return {Promise&lt;void>}
*/ */
this.activateNewNote = async notePath => { this.activateNewNote = async notePath => {
await treeService.reload(); await ws.waitForMaxKnownSyncId();
await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle); await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle);
}; };

View File

@ -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) * @param {string} notePath (or noteId)
* @return {Promise<void>} * @return {Promise<void>}
*/ */
this.activateNewNote = async notePath => { this.activateNewNote = async notePath => {
await treeService.reload(); await ws.waitForMaxKnownSyncId();
await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle); await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle);
}; };