main^2
Midnight 3 years ago
parent 0d72e0d608
commit f894d80c22

@ -23,10 +23,12 @@
$: number = commissions.length + 1; $: number = commissions.length + 1;
async function setup() { async function setup() {
let prefill = true;
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
urlParams.forEach((value, key) => { urlParams.forEach((value, key) => {
if(key == "commissions") { if(key == "commissions") {
try { try {
prefill = false;
commissions = JSON.parse(value); commissions = JSON.parse(value);
commissions.forEach(value => { commissions.forEach(value => {
types.forEach(element => { types.forEach(element => {
@ -42,12 +44,12 @@
console.log(value.example); console.log(value.example);
}); });
} catch(msg) { } catch(msg) {
commissions = []; prefill = true;
error = "The selected preset link failed to load. It may be from an old version of the commission picker. It has been replaced with the default preset below." error = "The selected preset link failed to load. It may be from an old version of the commission picker. It has been replaced with the default preset below."
} }
} }
}); });
if(commissions.length == 0) { if(prefill) {
base(); base();
} }
} }

Loading…
Cancel
Save