always use template strings instead of string concatenation

This commit is contained in:
zadam
2022-12-21 15:19:05 +01:00
parent ea006993f6
commit 1b24276a4a
154 changed files with 433 additions and 437 deletions

View File

@@ -150,7 +150,7 @@ export default class Entrypoints extends Component {
ipcRenderer.send('create-extra-window', {notePath, hoistedNoteId});
}
else {
const url = window.location.protocol + '//' + window.location.host + window.location.pathname + '?extra=1#' + notePath;
const url = `${window.location.protocol}//${window.location.host}${window.location.pathname}?extra=1#${notePath}`;
window.open(url, '', 'width=1000,height=800');
}
@@ -172,12 +172,12 @@ export default class Entrypoints extends Component {
if (note.mime.endsWith("env=frontend")) {
await bundleService.getAndExecuteBundle(note.noteId);
} else if (note.mime.endsWith("env=backend")) {
await server.post('script/run/' + note.noteId);
await server.post(`script/run/${note.noteId}`);
} else if (note.mime === 'text/x-sqlite;schema=trilium') {
const resp = await server.post("sql/execute/" + note.noteId);
const resp = await server.post(`sql/execute/${note.noteId}`);
if (!resp.success) {
toastService.showError("Error occurred while executing SQL query: " + resp.message);
toastService.showError(`Error occurred while executing SQL query: ${resp.message}`);
}
await appContext.triggerEvent('sqlQueryResults', {ntxId: ntxId, results: resp.results});