mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
refactored TabContext => NoteContext
This commit is contained in:
@@ -4,14 +4,14 @@ const REQUEST_LOGGING_ENABLED = false;
|
||||
|
||||
async function getHeaders(headers) {
|
||||
const appContext = (await import('./app_context.js')).default;
|
||||
const activeTabContext = appContext.tabManager ? appContext.tabManager.getActiveTabContext() : null;
|
||||
const activeNoteContext = appContext.tabManager ? appContext.tabManager.getActiveNoteContext() : null;
|
||||
|
||||
// headers need to be lowercase because node.js automatically converts them to lower case
|
||||
// also avoiding using underscores instead of dashes since nginx filters them out by default
|
||||
const allHeaders = {
|
||||
'trilium-source-id': glob.sourceId,
|
||||
'trilium-local-now-datetime': utils.localNowDateTime(),
|
||||
'trilium-hoisted-note-id': activeTabContext ? activeTabContext.hoistedNoteId : null,
|
||||
'trilium-hoisted-note-id': activeNoteContext ? activeNoteContext.hoistedNoteId : null,
|
||||
'x-csrf-token': glob.csrfToken
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user