Skip to content

Commit

Permalink
impr(result): not automatically showing words for long tests
Browse files Browse the repository at this point in the history
This should get rid of the lag that comes with loading a lot of word elements
  • Loading branch information
Miodec committed Oct 13, 2023
1 parent d355b36 commit 8f8872b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion frontend/src/ts/test/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import * as TestUI from "./test-ui";
import * as TodayTracker from "./today-tracker";
import * as ConfigEvent from "../observables/config-event";
import * as Focus from "./focus";
import * as CustomText from "./custom-text";
import * as CustomTextState from "./../states/custom-text-name";

import confetti from "canvas-confetti";
import type { AnnotationOptions } from "chartjs-plugin-annotation";
Expand Down Expand Up @@ -829,7 +831,20 @@ export async function update(
},
125
);
if (Config.alwaysShowWordsHistory && !GlarsesMode.get()) {

const canQuickRestart = Misc.canQuickRestart(
Config.mode,
Config.words,
Config.time,
CustomText,
CustomTextState.isCustomTextLong() ?? false
);

if (
Config.alwaysShowWordsHistory &&
canQuickRestart &&
!GlarsesMode.get()
) {
TestUI.toggleResultWords(true);
}
AdController.updateFooterAndVerticalAds(true);
Expand Down

0 comments on commit 8f8872b

Please sign in to comment.