Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CubesterYT committed Jan 20, 2025
1 parent 6c05a97 commit b5c1c15
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions extensions/CubesterYT/Webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
function setupStorage() {
if (!runtime.extensionStorage["cubesterWebhooks"]) {
runtime.extensionStorage["cubesterWebhooks"] = {
webhooks: {}
webhooks: {},
};
}
webhooks = runtime.extensionStorage["cubesterWebhooks"].webhooks;
if (keys(webhooks).length > 0) {
hideFromPalette = false;
}
}
setupStorage();
runtime.on("PROJECT_LOADED", setupStorage);
Expand Down Expand Up @@ -142,10 +145,10 @@
};
}

addWebhook() {
async addWebhook() {
let name;
do {
name = prompt(Scratch.translate("Enter Webhook name:"));
name = await prompt(Scratch.translate("Enter Webhook name:"));
if (name === null) {
return;
}
Expand All @@ -166,7 +169,7 @@
} while (keys(webhooks).includes(name) || name === "");
let URL;
do {
URL = prompt(Scratch.translate("Enter Webhook URL:"));
URL = await prompt(Scratch.translate("Enter Webhook URL:"));
if (URL === null) {
return;
}
Expand All @@ -182,10 +185,10 @@
hideFromPalette = false;
Scratch.vm.extensionManager.refreshBlocks("cubesterWebhooks");
}
deleteWebhook() {
async deleteWebhook() {
let name;
do {
name = prompt(Scratch.translate("Enter Webhook name:"));
name = await prompt(Scratch.translate("Enter Webhook name:"));
if (name === null) {
return;
}
Expand Down

0 comments on commit b5c1c15

Please sign in to comment.