🐛 Fixed more errors coming from upgrading SvelteKit

This commit is contained in:
Mawoka
2022-08-18 17:07:02 +02:00
parent cacd727c0e
commit dcddb3b764
14 changed files with 51 additions and 36 deletions
@@ -1,7 +1,8 @@
import { signedIn } from '$lib/stores';
export async function load({ url, session }) {
if (session.authenticated) {
export async function load({ url, parent }) {
const { email } = await parent();
if (email) {
signedIn.set(true);
}
const token = url.searchParams.get('pin');
+9 -5
View File
@@ -1,8 +1,4 @@
<!--
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/.
-->
<!--suppress ALL -->
<script lang="ts">
import { socket } from '$lib/socket';
import JoinGame from '$lib/play/join.svelte';
@@ -49,6 +45,8 @@
const confirmUnload = () => {
event.preventDefault();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
event.returnValue = '';
};
@@ -94,6 +92,12 @@
// The rest
</script>
<!--
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at https://mozilla.org/MPL/2.0/.
-->
<svelte:window on:beforeunload={confirmUnload} />
<svelte:head>
<title>ClassQuiz - Play</title>