mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix cache invalidation upon note title change
This commit is contained in:
parent
147160ed45
commit
5ad47d3866
@ -70,7 +70,9 @@ function reload() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function postProcessEntityUpdate(entityName, entity) {
|
function postProcessEntityUpdate(entityName, entity) {
|
||||||
if (entityName === 'branches') {
|
if (entityName === 'notes') {
|
||||||
|
noteUpdated(entity);
|
||||||
|
} else if (entityName === 'branches') {
|
||||||
branchUpdated(entity);
|
branchUpdated(entity);
|
||||||
} else if (entityName === 'attributes') {
|
} else if (entityName === 'attributes') {
|
||||||
attributeUpdated(entity);
|
attributeUpdated(entity);
|
||||||
@ -161,6 +163,15 @@ function branchDeleted(branchId) {
|
|||||||
delete becca.branches[branch.branchId];
|
delete becca.branches[branch.branchId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function noteUpdated(entity) {
|
||||||
|
const note = becca.notes[entity.noteId];
|
||||||
|
|
||||||
|
if (note) {
|
||||||
|
// type / mime could have been changed, and they are present in flatTextCache
|
||||||
|
note.flatTextCache = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function branchUpdated(branch) {
|
function branchUpdated(branch) {
|
||||||
const childNote = becca.notes[branch.noteId];
|
const childNote = becca.notes[branch.noteId];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user