Merge pull request #70 from chriswolfdesign/69-replace-assign-conversion

This commit is contained in:
Mawoka
2022-07-24 11:26:23 +02:00
committed by GitHub
5 changed files with 8 additions and 8 deletions
@@ -52,7 +52,7 @@
}); });
const data = await response.json(); const data = await response.json();
if (response.status === 200) { if (response.status === 200) {
window.location.replace('/account/login'); window.location.assign('/account/login');
} else { } else {
alert(data.detail); alert(data.detail);
} }
+1 -1
View File
@@ -368,7 +368,7 @@
type="button" type="button"
on:click={() => { on:click={() => {
responseData.open = false; responseData.open = false;
window.location.replace('/'); window.location.assign('/');
}} }}
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
>{$t('words.close')} >{$t('words.close')}
+3 -3
View File
@@ -77,7 +77,7 @@
}); });
if (res.status === 200) { if (res.status === 200) {
alert('Password changed'); alert('Password changed');
window.location.replace('/account/login'); window.location.assign('/account/login');
} else { } else {
alert('Password change failed'); alert('Password change failed');
} }
@@ -93,7 +93,7 @@
if (response.status === 200) { if (response.status === 200) {
return await response.json(); return await response.json();
} else { } else {
window.location.replace('/account/login'); window.location.assign('/account/login');
} }
}; };
const formatDate = (date: string): string => { const formatDate = (date: string): string => {
@@ -110,7 +110,7 @@
} }
return await res.json(); return await res.json();
} else { } else {
window.location.replace('/account/login?returnTo=/account/settings'); window.location.assign('/account/login?returnTo=/account/settings');
} }
return await res.json(); return await res.json();
}; };
+2 -2
View File
@@ -71,13 +71,13 @@
body: `Failed to start game, ${await res.text()}` body: `Failed to start game, ${await res.text()}`
}); });
alertModal.subscribe((_) => { alertModal.subscribe((_) => {
window.location.replace('/account/login?returnTo=/overview'); window.location.assign('/account/login?returnTo=/overview');
}); });
} }
const data = await res.json(); const data = await res.json();
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
plausible('Started Game', { props: { quiz_id: id } }); plausible('Started Game', { props: { quiz_id: id } });
window.location.replace(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`); window.location.assign(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`);
}; };
const deleteQuiz = async (to_delete: string) => { const deleteQuiz = async (to_delete: string) => {
+1 -1
View File
@@ -86,7 +86,7 @@
const data = await res.json(); const data = await res.json();
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
plausible('Started Game', { props: { quiz_id: id } }); plausible('Started Game', { props: { quiz_id: id } });
window.location.replace(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`); window.location.assign(`/admin?token=${data.game_id}&pin=${data.game_pin}&connect=1`);
}; };
</script> </script>