Skip to content

Commit

Permalink
update for VedalAI#25
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyrenth committed Jun 10, 2024
1 parent fc1c11d commit ef2fae7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/www/src/modules/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,6 @@ Twitch.ext.bits.onTransactionCancelled(async () => {
],
}).then();
}
hideProcessingModal();
showErrorModal("Transaction cancelled.", `Transaction ID: ${transactionToken}`);
});
7 changes: 7 additions & 0 deletions frontend/www/src/modules/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ document.addEventListener("DOMContentLoaded", () => {
e.preventDefault();
setCartArgsFromForm(e.target as HTMLFormElement);
};

$modalWrapper.onclick = (e) => {
if (e.target !== $modalWrapper) return;
if ($modalProcessing.style.opacity == "1") return;

closeModal();
};
});

export async function openModal(redeem: Redeem | null) {
Expand Down
8 changes: 6 additions & 2 deletions frontend/www/src/modules/redeems.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { openModal, showErrorModal } from "./modal";
import { hideProcessingModal, openModal, showErrorModal } from "./modal";
import { getConfig } from "../util/config";

const $mainContainer = document.getElementsByTagName("main")!;
const $redeemContainer = document.getElementById("items")!;
const $modalProcessing = document.getElementById("modal-processing")!;

document.addEventListener("DOMContentLoaded", () => {
renderRedeemButtons().then();
Expand Down Expand Up @@ -62,5 +63,8 @@ export async function renderRedeemButtons() {
$redeemContainer.appendChild(item);
}

showErrorModal("New update!", "The items have been updated, because of this you need to reopen this modal.");
if ($modalProcessing.style.opacity !== "1") {
hideProcessingModal();
showErrorModal("New update!", "The items have been updated, because of this you need to reopen this modal.");
}
}

0 comments on commit ef2fae7

Please sign in to comment.