Skip to content

Commit

Permalink
Typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gbtami committed Dec 19, 2024
1 parent 6a2a415 commit c11d010
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions client/lobby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { handleOngoingGameEvents, Game, gameViewPlaying, compareGames } from './
import { createWebsocket } from "@/socket/webSocketUtils";


const autoPairingTCs = [
const autoPairingTCs: [number, number, number][] = [
[1, 0, 0],
[3, 0, 0],
[3, 2, 0],
Expand Down Expand Up @@ -564,7 +564,7 @@ export class LobbyController implements ChatController {
}

autoPairingSubmit() {
const variants = [];
const variants: [string, boolean][] = [];
document.querySelectorAll('input[name^="va_"]').forEach((inp: HTMLInputElement) => {
localStorage[inp.name] = inp.checked;
if (inp.checked) {
Expand All @@ -574,8 +574,8 @@ export class LobbyController implements ChatController {
}
})

const tcs = [];
document.querySelectorAll('input[name^="tc_"]').forEach((inp: HTMLInputElement, index) => {
const tcs: [number, number, number][] = [];
document.querySelectorAll('input[name^="tc_"]').forEach((inp: HTMLInputElement, index: number) => {
localStorage[inp.name] = inp.checked;
if (inp.checked) tcs.push(autoPairingTCs[index]);
})
Expand Down Expand Up @@ -948,12 +948,7 @@ export class LobbyController implements ChatController {
}

renderAutoPairingTable() {
// TODO: load/save from localStorage
// TODO: call createAutoPairing() on clicking SUBMIT button
const asVariants = localStorage.auto_seek_variants ?? "";
const asTCs = localStorage.auto_seek_tcs ?? "";

const variantList = [];
const variantList: VNode[] = [];
enabledVariants.forEach(v => {
const variant = VARIANTS[v];
let variantName = variant.name;
Expand All @@ -968,7 +963,7 @@ export class LobbyController implements ChatController {
}
})

const tcList = [];
const tcList: VNode[] = [];
autoPairingTCs.forEach(v => {
const tcName = timeControlStr(v[0], v[1], v[2]);
const checked = localStorage[`tc_${tcName}`] ?? "false";
Expand Down

0 comments on commit c11d010

Please sign in to comment.