mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 18:04:27 +08:00
Refactor
This commit is contained in:
parent
ab4f0fceb5
commit
3b9e119044
1 changed files with 13 additions and 11 deletions
|
|
@ -151,17 +151,19 @@ const actionModals: Record<Action, SimpleModal> = {
|
|||
};
|
||||
}
|
||||
|
||||
DB.getSnapshot()?.tags?.forEach((tag) => {
|
||||
if (tag._id === tagId) {
|
||||
tag.personalBests = {
|
||||
time: {},
|
||||
words: {},
|
||||
quote: {},
|
||||
zen: {},
|
||||
custom: {},
|
||||
};
|
||||
}
|
||||
});
|
||||
const matchingTag = DB.getSnapshot()?.tags.find(
|
||||
(tag) => tag._id === tagId,
|
||||
);
|
||||
|
||||
if (matchingTag !== undefined) {
|
||||
matchingTag.personalBests = {
|
||||
time: {},
|
||||
words: {},
|
||||
quote: {},
|
||||
zen: {},
|
||||
custom: {},
|
||||
};
|
||||
}
|
||||
|
||||
void Settings.update();
|
||||
return { status: 1, message: `Tag PB cleared` };
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue