fixes for SQL console

This commit is contained in:
zadam
2021-02-15 20:44:55 +01:00
parent c41448f5da
commit e212a37c84
3 changed files with 16 additions and 20 deletions

View File

@@ -206,7 +206,8 @@ export default class Entrypoints extends Component {
}
async runActiveNoteCommand() {
const note = appContext.tabManager.getActiveTabNote();
const tabContext = appContext.tabManager.getActiveTabContext();
const note = tabContext.note;
// ctrl+enter is also used elsewhere so make sure we're running only when appropriate
if (!note || note.type !== 'code') {
@@ -220,7 +221,7 @@ export default class Entrypoints extends Component {
} else if (note.mime === 'text/x-sqlite;schema=trilium') {
const result = await server.post("sql/execute/" + note.noteId);
this.triggerEvent('sqlQueryResults', {results: result.results});
this.triggerEvent('sqlQueryResults', {tabId: tabContext.tabId, results: result.results});
}
toastService.showMessage("Note executed");