mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 23:13:43 +08:00
small fixes
This commit is contained in:
parent
b30792a3da
commit
1e8472266f
4 changed files with 13 additions and 3 deletions
|
@ -213,9 +213,13 @@ export default class Entrypoints extends Component {
|
|||
} else if (note.mime.endsWith("env=backend")) {
|
||||
await server.post('script/run/' + note.noteId);
|
||||
} else if (note.mime === 'text/x-sqlite;schema=trilium') {
|
||||
const {results} = await server.post("sql/execute/" + note.noteId);
|
||||
const resp = await server.post("sql/execute/" + note.noteId);
|
||||
|
||||
await appContext.triggerEvent('sqlQueryResults', {ntxId: ntxId, results: results});
|
||||
if (!resp.success) {
|
||||
alert("Error occurred while executing SQL query: " + resp.message);
|
||||
}
|
||||
|
||||
await appContext.triggerEvent('sqlQueryResults', {ntxId: ntxId, results: resp.results});
|
||||
}
|
||||
|
||||
toastService.showMessage("Note executed");
|
||||
|
|
|
@ -83,6 +83,10 @@ async function resolveNotePathToSegments(notePath, hoistedNoteId = 'root', logEr
|
|||
if (someNotePath) { // in case it's root the path may be empty
|
||||
const pathToRoot = someNotePath.split("/").reverse().slice(1);
|
||||
|
||||
if (!pathToRoot.includes("root")) {
|
||||
pathToRoot.push('root');
|
||||
}
|
||||
|
||||
for (const noteId of pathToRoot) {
|
||||
effectivePathSegments.push(noteId);
|
||||
}
|
||||
|
|
|
@ -258,7 +258,8 @@ class ConsistencyChecks {
|
|||
FROM branches
|
||||
WHERE noteId = ?
|
||||
and parentNoteId = ?
|
||||
and isDeleted = 0`, [noteId, parentNoteId]);
|
||||
and isDeleted = 0
|
||||
ORDER BY utcDateCreated`, [noteId, parentNoteId]);
|
||||
|
||||
const branches = branchIds.map(branchId => becca.getBranch(branchId));
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ function getHiddenRoot() {
|
|||
|
||||
if (!hidden) {
|
||||
hidden = noteService.createNewNote({
|
||||
branchId: 'hidden',
|
||||
noteId: 'hidden',
|
||||
title: 'hidden',
|
||||
type: 'text',
|
||||
|
|
Loading…
Reference in a new issue