mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-11 01:15:49 +08:00
Merge branch 'master' into newads
This commit is contained in:
commit
ffd3a96477
1 changed files with 10 additions and 2 deletions
|
@ -417,7 +417,7 @@ export async function updateCrown(): Promise<void> {
|
|||
);
|
||||
}
|
||||
|
||||
function updateTags(dontSave: boolean): void {
|
||||
async function updateTags(dontSave: boolean): Promise<void> {
|
||||
const activeTags: MonkeyTypes.Tag[] = [];
|
||||
const userTagsCount = DB.getSnapshot()?.tags?.length ?? 0;
|
||||
try {
|
||||
|
@ -445,6 +445,14 @@ function updateTags(dontSave: boolean): void {
|
|||
);
|
||||
$("#result .stats .tags .editTagsButton").addClass("invisible");
|
||||
|
||||
const funboxes = result.funbox?.split("#") ?? [];
|
||||
|
||||
const funboxObjects = await Promise.all(
|
||||
funboxes.map(async (f) => Misc.getFunbox(f))
|
||||
);
|
||||
|
||||
const allFunboxesCanGetPb = funboxObjects.every((f) => f?.canGetPb);
|
||||
|
||||
let annotationSide = "start";
|
||||
let labelAdjust = 15;
|
||||
activeTags.forEach(async (tag) => {
|
||||
|
@ -463,7 +471,7 @@ function updateTags(dontSave: boolean): void {
|
|||
if (
|
||||
Config.mode != "quote" &&
|
||||
!dontSave &&
|
||||
(await Misc.getFunbox(result.funbox ?? ""))?.canGetPb === true
|
||||
(funboxes.length === 0 || allFunboxesCanGetPb)
|
||||
) {
|
||||
if (tpb < result.wpm) {
|
||||
//new pb for that tag
|
||||
|
|
Loading…
Reference in a new issue