Skip to content

Commit

Permalink
fix multiple body consumption
Browse files Browse the repository at this point in the history
  • Loading branch information
Govorunb committed Jun 12, 2024
1 parent ab54bae commit 0d9c7c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/www/src/modules/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,26 @@ Twitch.ext.bits.onTransactionComplete(async (transaction) => {

setTimeout(() => hideProcessingModal(), 250);

const text = await result.text();
if (result.ok) {
// Transaction token can no longer be used to log
showSuccessModal("Purchase completed", `${await result.text()}\nTransaction ID: ${transactionToken}`);
showSuccessModal("Purchase completed", `${text}\nTransaction ID: ${transactionToken}`);
} else {
const errorText = `${result.status} ${result.statusText} - ${text}`;
logToDiscord({
transactionToken: transactionToken,
userIdInsecure: Twitch.ext.viewer.id!,
important: true,
fields: [
{
header: "Transaction failed (frontend)",
content: `${result.status} ${result.statusText} - ${await result.text()}`,
content: errorText,
},
],
}).then();
showErrorModal(
"An error occurred.",
`${result.status} ${result.statusText} - ${await result.text()}\nPlease contact a moderator (preferably AlexejheroDev) about this!\nTransaction ID: ${transactionToken}`
`${errorText}\nPlease contact a moderator (preferably AlexejheroDev) about this!\nTransaction ID: ${transactionToken}`
);
}
});
Expand Down

0 comments on commit 0d9c7c8

Please sign in to comment.