From 6a9450d0e66315d24044025b9ef4e21a16c71f3b Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Tue, 31 Oct 2023 12:03:45 +0100 Subject: [PATCH] Simplify closing email verification status banner --- .../lib/email/EmailVerificationStatus.svelte | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/frontend/src/lib/email/EmailVerificationStatus.svelte b/frontend/src/lib/email/EmailVerificationStatus.svelte index 6b7872dfe..ebeebaa2a 100644 --- a/frontend/src/lib/email/EmailVerificationStatus.svelte +++ b/frontend/src/lib/email/EmailVerificationStatus.svelte @@ -11,8 +11,7 @@ import type { LexAuthUser } from '$lib/user'; import { EmailResult } from '.'; import { Button } from '$lib/forms'; - import { onDestroy } from 'svelte'; - import { Duration } from '$lib/util/time'; + import { onNavigate } from '$app/navigation'; export let user: LexAuthUser; @@ -30,20 +29,9 @@ } } - const emailResultUnsubscriber = emailResult.subscribe((result) => { - if (result) { - setTimeout(() => emailResult.set(null), Duration.Medium); - } - }); - const requestedEmailUnsubscriber = requestedEmail.subscribe((result) => { - if (result) { - setTimeout(() => requestedEmail.set(null), Duration.Long); - } - }); - - onDestroy(() => { - emailResultUnsubscriber(); - requestedEmailUnsubscriber(); + onNavigate(() => { + emailResult.set(null); + requestedEmail.set(null); });