mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-15 03:44:31 +08:00
Update tags after deletion
This commit is contained in:
parent
69cc227c87
commit
ae88cd4aa6
2 changed files with 11 additions and 0 deletions
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ const actionModals: Record<Action, SimpleModal> = {
|
|||
}
|
||||
});
|
||||
void Settings.update();
|
||||
|
||||
await DB.updateTagAfterDelete(tagId);
|
||||
return { status: 1, message: `Tag removed` };
|
||||
},
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue