mirror of
https://github.com/zadam/trilium.git
synced 2025-01-29 02:18:18 +08:00
activateNewNote does not reload whole tree anymore
This commit is contained in:
parent
acb76e0630
commit
2150619d62
5 changed files with 7 additions and 7 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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'
|
||||
});
|
||||
|
|
|
@ -807,7 +807,7 @@
|
|||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -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<void>}
|
||||
*/
|
||||
this.activateNewNote = async notePath => {
|
||||
await treeService.reload();
|
||||
await ws.waitForMaxKnownSyncId();
|
||||
|
||||
await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue