mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix some issues
This commit is contained in:
parent
09b610701d
commit
17348a9cfe
@ -13,7 +13,7 @@ let codeEditorInitialized;
|
||||
async function show() {
|
||||
codeEditorInitialized = false;
|
||||
|
||||
$noteDetailRender.show();
|
||||
$noteDetailRender.empty().show();
|
||||
|
||||
await render();
|
||||
}
|
||||
|
@ -272,6 +272,13 @@ async function deleteNote(branch) {
|
||||
attribute.isDeleted = true;
|
||||
await attribute.save();
|
||||
}
|
||||
|
||||
const targetAttributes = await repository.getEntities("SELECT * FROM attributes WHERE type = 'relation' AND isDeleted = 0 AND value = ?", [note.noteId]);
|
||||
|
||||
for (const attribute of targetAttributes) {
|
||||
attribute.isDeleted = true;
|
||||
await attribute.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,9 @@ async function getScriptBundle(note, root = true, scriptEnv = null, includedNote
|
||||
apiContext.modules['${note.noteId}'] = {};
|
||||
${root ? 'return ' : ''}await (async function(exports, module, require, api` + (modules.length > 0 ? ', ' : '') +
|
||||
modules.map(child => sanitizeVariableName(child.title)).join(', ') + `) {
|
||||
try {${note.content};} catch (e) { throw new Error("Load of script note \\"${note.title}\\" (${note.noteId}) failed with: " + e.message); }
|
||||
try {
|
||||
${note.content};
|
||||
} catch (e) { throw new Error("Load of script note \\"${note.title}\\" (${note.noteId}) failed with: " + e.message); }
|
||||
if (!module.exports) module.exports = {};
|
||||
for (const exportKey in exports) module.exports[exportKey] = exports[exportKey];
|
||||
})({}, apiContext.modules['${note.noteId}'], apiContext.require(${JSON.stringify(moduleNoteIds)}), apiContext.apis['${note.noteId}']` + (modules.length > 0 ? ', ' : '') +
|
||||
|
Loading…
x
Reference in New Issue
Block a user