Skip to content

Commit

Permalink
fix cache invalidation upon note title change
Browse files Browse the repository at this point in the history
  • Loading branch information
zadam committed Mar 17, 2023
1 parent 147160e commit 5ad47d3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/becca/becca_loader.js
Expand Up @@ -70,7 +70,9 @@ function reload() {
}

function postProcessEntityUpdate(entityName, entity) {
if (entityName === 'branches') {
if (entityName === 'notes') {
noteUpdated(entity);
} else if (entityName === 'branches') {
branchUpdated(entity);
} else if (entityName === 'attributes') {
attributeUpdated(entity);
Expand Down Expand Up @@ -161,6 +163,15 @@ function branchDeleted(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) {
const childNote = becca.notes[branch.noteId];

Expand Down

0 comments on commit 5ad47d3

Please sign in to comment.