mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
date note fixes
This commit is contained in:
parent
e04845335b
commit
b7344329f4
@ -8,27 +8,21 @@ async function getTodayNote() {
|
||||
|
||||
/** @return {NoteShort} */
|
||||
async function getDateNote(date) {
|
||||
const note = await server.get('date-notes/date/' + date);
|
||||
|
||||
await treeCache.reloadNotes([note.noteId]);
|
||||
const note = await server.get('date-notes/date/' + date, {'trilium-source-id': "date-note"});
|
||||
|
||||
return await treeCache.getNote(note.noteId);
|
||||
}
|
||||
|
||||
/** @return {NoteShort} */
|
||||
async function getMonthNote(month) {
|
||||
const note = await server.get('date-notes/month/' + month);
|
||||
|
||||
await treeCache.reloadNotes([note.noteId]);
|
||||
const note = await server.get('date-notes/month/' + month, {'trilium-source-id': "date-note"});
|
||||
|
||||
return await treeCache.getNote(note.noteId);
|
||||
}
|
||||
|
||||
/** @return {NoteShort} */
|
||||
async function getYearNote(year) {
|
||||
const note = await server.get('date-notes/year/' + year);
|
||||
|
||||
await treeCache.reloadNotes([note.noteId]);
|
||||
const note = await server.get('date-notes/year/' + year, {'trilium-source-id': "date-note"});
|
||||
|
||||
return await treeCache.getNote(note.noteId);
|
||||
}
|
||||
|
@ -64,15 +64,15 @@ async function call(method, url, data, headers = {}) {
|
||||
});
|
||||
}
|
||||
else {
|
||||
return await ajax(url, method, data);
|
||||
return await ajax(url, method, data, headers);
|
||||
}
|
||||
}
|
||||
|
||||
async function ajax(url, method, data) {
|
||||
async function ajax(url, method, data, headers) {
|
||||
const options = {
|
||||
url: baseApiUrl + url,
|
||||
type: method,
|
||||
headers: getHeaders(),
|
||||
headers: getHeaders(headers),
|
||||
timeout: 60000
|
||||
};
|
||||
|
||||
|
@ -55,8 +55,6 @@ class TreeCache {
|
||||
if (childNote) {
|
||||
childNote.parents = childNote.parents.filter(p => p !== noteId);
|
||||
|
||||
console.log("Cleaning up", childNote.parentToBranch[noteId]);
|
||||
|
||||
delete this.branches[childNote.parentToBranch[noteId]];
|
||||
delete childNote.parentToBranch[noteId];
|
||||
}
|
||||
@ -75,10 +73,6 @@ class TreeCache {
|
||||
}
|
||||
|
||||
for (const branch of branchesByNotes[noteId] || []) { // can be empty for deleted notes
|
||||
if (noteId === '2Ndfjyv3EbEQ') {
|
||||
console.log("Adding", branch.branchId);
|
||||
}
|
||||
|
||||
this.branches[branch.branchId] = branch;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ const syncOptions = require('./sync_options');
|
||||
const syncMutexService = require('./sync_mutex');
|
||||
const cls = require('./cls');
|
||||
const request = require('./request');
|
||||
const ws = require('./ws');
|
||||
|
||||
let proxyToggle = true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user