mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix some issues
This commit is contained in:
		| @@ -13,7 +13,7 @@ let codeEditorInitialized; | |||||||
| async function show() { | async function show() { | ||||||
|     codeEditorInitialized = false; |     codeEditorInitialized = false; | ||||||
|  |  | ||||||
|     $noteDetailRender.show(); |     $noteDetailRender.empty().show(); | ||||||
|  |  | ||||||
|     await render(); |     await render(); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -272,6 +272,13 @@ async function deleteNote(branch) { | |||||||
|             attribute.isDeleted = true; |             attribute.isDeleted = true; | ||||||
|             await attribute.save(); |             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}'] = {}; | apiContext.modules['${note.noteId}'] = {}; | ||||||
| ${root ? 'return ' : ''}await (async function(exports, module, require, api` + (modules.length > 0 ? ', ' : '') + | ${root ? 'return ' : ''}await (async function(exports, module, require, api` + (modules.length > 0 ? ', ' : '') + | ||||||
|             modules.map(child => sanitizeVariableName(child.title)).join(', ') + `) { |             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 = {}; | if (!module.exports) module.exports = {}; | ||||||
| for (const exportKey in exports) module.exports[exportKey] = exports[exportKey]; | 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 ? ', ' : '') + | })({}, apiContext.modules['${note.noteId}'], apiContext.require(${JSON.stringify(moduleNoteIds)}), apiContext.apis['${note.noteId}']` + (modules.length > 0 ? ', ' : '') + | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user