From 7632a7931d4171aa4608623683e17c1b5675a118 Mon Sep 17 00:00:00 2001 From: Oliver Akins Date: Thu, 17 Feb 2022 17:22:00 -0600 Subject: [PATCH] Add a querystring option to disable the poll create success message --- site/alkali_metal.html | 7 +++++-- site/czechgamesedition.html | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/site/alkali_metal.html b/site/alkali_metal.html index 6940a0e..052d9ab 100644 --- a/site/alkali_metal.html +++ b/site/alkali_metal.html @@ -76,8 +76,11 @@ let app = new Vue({ methods: { async start_poll(poll_data) { try { - let r = await axios.post("/twitch/alkali_metal/poll", poll_data); - alert("Poll should've been created successfully."); + await axios.post("/polls/twitch/alkali_metal/poll", poll_data); + let qs = new URLSearchParams(window.location.search); + if (!qs.has("no_alert")) { + alert("Poll should've been created successfully."); + }; } catch (err) { console.error(err); alert("Something went wrong starting the poll, check to see if one is made already.") diff --git a/site/czechgamesedition.html b/site/czechgamesedition.html index 9267b77..fbf9467 100644 --- a/site/czechgamesedition.html +++ b/site/czechgamesedition.html @@ -76,8 +76,11 @@ let app = new Vue({ methods: { async start_poll(poll_data) { try { - let r = await axios.post("/polls/twitch/czechgamesedition/poll", poll_data); - alert("Poll should've been created successfully."); + await axios.post("/polls/twitch/czechgamesedition/poll", poll_data); + let qs = new URLSearchParams(window.location.search); + if (!qs.has("no_alert")) { + alert("Poll should've been created successfully."); + }; } catch (err) { console.error(err); alert("Something went wrong starting the poll, check to see if one is made already.")