Update tags after deletion

This commit is contained in:
Leonabcd123 2026-01-09 22:09:25 +02:00
parent 69cc227c87
commit ae88cd4aa6
2 changed files with 11 additions and 0 deletions

View file

@ -875,6 +875,15 @@ export async function saveLocalTagPB<M extends Mode>(
return;
}
export async function updateTagAfterDelete(tagId: string): Promise<void> {
getSnapshot()?.results?.forEach((result) => {
const tagIndex = result.tags.indexOf(tagId);
if (tagIndex > -1) {
result.tags.splice(tagIndex, 1);
}
});
}
export async function updateLbMemory<M extends Mode>(
mode: M,
mode2: Mode2<M>,

View file

@ -126,6 +126,8 @@ const actionModals: Record<Action, SimpleModal> = {
}
});
void Settings.update();
await DB.updateTagAfterDelete(tagId);
return { status: 1, message: `Tag removed` };
},
}),