parent
d0c56d5d76
commit
59e639eed6
3 changed files with 37 additions and 7 deletions
|
@ -95,7 +95,7 @@ async function renderDetails(childRow: HTMLDivElement, gameid: number) {
|
|||
childRow.removeChild(loadingContainer);
|
||||
|
||||
const parser = new DOMParser();
|
||||
const gameDisplay: HTMLDivElement|null = parser.parseFromString(getDetailsHTML(gameData), 'text/html').body.firstChild;
|
||||
const gameDisplay: HTMLDivElement|null = <HTMLDivElement|null>(parser.parseFromString(getDetailsHTML(gameData), 'text/html').body.firstChild);
|
||||
|
||||
if (!gameDisplay) {
|
||||
return;
|
||||
|
@ -103,10 +103,10 @@ async function renderDetails(childRow: HTMLDivElement, gameid: number) {
|
|||
|
||||
gameDisplay.querySelectorAll('.claim-btn').forEach(btn => {
|
||||
btn.addEventListener('click', async () => {
|
||||
const key = btn.closest('.key')?.dataset.keyId ?? 0;
|
||||
const key = btn.closest<HTMLDivElement>('.key')?.dataset.keyId ?? 0;
|
||||
|
||||
const formData = new FormData();
|
||||
formData.set('keyid', key);
|
||||
formData.set('keyid', key.toString());
|
||||
|
||||
const response = await fetch(CLAIM_URL, {
|
||||
method: 'POST',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue