Bugfix: TS typing check

This commit is contained in:
Ben Allfree 2022-11-16 05:56:02 -08:00
parent 6c76842511
commit b74dc5dee7

View File

@ -1,10 +1,10 @@
<script lang="ts">
import { browser } from '$app/environment'
import { page } from '$app/stores'
import { handleAccountConfirmation } from '$util/database'
import AlertBar from '$components/AlertBar.svelte'
import { handleAccountConfirmation } from '$util/database'
let token: string = ''
let token: string | null = ''
let formError: string = ''
// Check for a token in the URL
@ -22,6 +22,9 @@
}
const handleLoad = async () => {
if (!token) {
throw new Error(`Expected valid token here`)
}
await handleAccountConfirmation(token, (error) => {
formError = error
})