on a page

This commit is contained in:
Christian Fehmer 2026-01-08 14:58:59 +01:00
parent 396b95e48b
commit 0e4bcfa4ba
No known key found for this signature in database
GPG key ID: A567394D76EBDD7C
3 changed files with 20 additions and 2 deletions

View file

@ -80,6 +80,10 @@
</button>
</div>
</div>
<div>
Your speed style is:
<div id="accountSpeedStyle"></div>
</div>
<div class="leaderboardsPositions">
<div class="title">All-Time English Leaderboards</div>
<div class="group t15">

View file

@ -36,7 +36,7 @@ import Ape from "../ape";
import { AccountChart } from "@monkeytype/schemas/configs";
import { SortedTableWithLimit } from "../utils/sorted-table";
import { qs, qsa, qsr, onWindowLoad, ElementWithUtils } from "../utils/dom";
import { mountAccountPage } from "../test/live-states";
let filterDebug = false;
//toggle filterdebug
export function toggleFilterDebug(): void {
@ -51,6 +51,8 @@ let visibleTableLines = 0;
let testActivityEl: HTMLElement | null;
let historyTable: SortedTableWithLimit<SnapshotResult<Mode>>;
let accountDispose: () => void;
function loadMoreLines(lineIndex?: number): void {
if (filteredResults === undefined || filteredResults.length === 0) return;
let newVisibleLines;
@ -564,7 +566,7 @@ async function fillContent(): Promise<void> {
histogramChartData.push(0);
}
}
(histogramChartData[bucket] as number)++;
(histogramChartData[bucket] as number) += 1;
let tt = 0;
if (
@ -1243,10 +1245,12 @@ export const page = new Page<undefined>({
afterHide: async (): Promise<void> => {
reset();
Skeleton.remove("pageAccount");
accountDispose?.();
},
beforeShow: async (): Promise<void> => {
Skeleton.append("pageAccount", "main");
const snapshot = DB.getSnapshot();
accountDispose = mountAccountPage();
await ResultFilters.appendDropdowns(update);
ResultFilters.updateActive();
await Misc.sleep(0);

View file

@ -15,3 +15,13 @@ export function mountLiveCounters(): void {
qsr("#liveSpeedCounter").native,
);
}
export function mountAccountPage(): () => void {
const speedStyleDispose = render(
() => <LiveCounter value={getLiveSpeedStyle} />,
qsr("#accountSpeedStyle").native,
);
return () => {
speedStyleDispose();
};
}