mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
activateNewNote does not reload whole tree anymore
This commit is contained in:
parent
acb76e0630
commit
2150619d62
@ -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();
|
||||||
|
|
||||||
|
@ -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'
|
||||||
});
|
});
|
||||||
|
@ -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>
|
||||||
|
|
||||||
|
|
||||||
|
@ -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<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);
|
||||||
};
|
};
|
||||||
|
@ -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);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user