Skip to content

Commit f9f6af7

Browse files
lgarronJJ_EMPTY_STRING
authored andcommitted
Change "Reset current matchup" button to just "Reset".
1 parent 8025a73 commit f9f6af7

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/dev/head-to-head/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ const app = document.body.appendChild(
165165
matchupToggleDNF,
166166
matchupFinishAttemptCallback,
167167
refreshCurrentMatchupsCallback,
168-
resetMatchupCallback: async (matchupID) =>
169-
console.log("Reset matchup:", { matchupID }),
168+
resetCallback: async (matchupID) => console.log("Reset:", { matchupID }),
170169
matchupSelectedCallback,
171170
},
172171
showMatchupsSelection: "show",

src/lib/elements/ScrambleTableMatchupSelection.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
</select>
88
<button class="refresh-matchups">🔄 Refresh matchups</button>
99
<span></span>
10-
<button class="reset-current-matchup">❌ Reset current matchup</button>
10+
<button class="reset">❌ Reset</button>
1111
</template>

src/lib/elements/ScrambleTableMatchupSelection.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export class ScrambleTableMatchupSelection extends HTMLElement {
2121
this.refreshMatchups();
2222

2323
this.#resetCurrentMatchups.addEventListener("click", async () => {
24-
const { resetMatchupCallback } = this.sharedState.callbacks;
25-
if (resetMatchupCallback) {
24+
const { resetCallback } = this.sharedState.callbacks;
25+
if (resetCallback) {
2626
await this.resetCurrentMatchup();
2727
}
2828
});
@@ -44,7 +44,7 @@ export class ScrambleTableMatchupSelection extends HTMLElement {
4444
}
4545

4646
get #resetCurrentMatchups(): HTMLButtonElement {
47-
return this.querySelector(".reset-current-matchup");
47+
return this.querySelector(".reset");
4848
}
4949

5050
private async refreshMatchups(): Promise<void> {
@@ -55,9 +55,9 @@ export class ScrambleTableMatchupSelection extends HTMLElement {
5555
}
5656

5757
private async resetCurrentMatchup(): Promise<void> {
58-
const { resetMatchupCallback } = this.sharedState.callbacks;
59-
if (resetMatchupCallback) {
60-
await resetMatchupCallback(this.#select.value);
58+
const { resetCallback } = this.sharedState.callbacks;
59+
if (resetCallback) {
60+
await resetCallback(this.#select.value);
6161
}
6262
// TODO: what should we reset here?
6363
}

src/lib/elements/SharedState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface ScrambleTableCallbacks {
3737
refreshCurrentMatchupsCallback?: () => Promise<
3838
Record<MatchupID, MatchupName>
3939
>;
40-
resetMatchupCallback?: (matchupID: MatchupID) => Promise<void>;
40+
resetCallback?: (matchupID: MatchupID) => Promise<void>;
4141
// Use this to e.g. call `setScramble(…)` on the competitor scramble displays.
4242
matchupSelectedCallback?: (matchupID: MatchupID) => void;
4343
}

0 commit comments

Comments
 (0)