mirror of
https://github.com/gurucomputing/headscale-ui.git
synced 2026-07-18 00:46:59 +00:00
fix alert to be within onmount scope
This commit is contained in:
parent
73f1314cc1
commit
7ac3405178
1 changed files with 5 additions and 3 deletions
|
|
@ -1,13 +1,15 @@
|
|||
<script lang="ts">
|
||||
import { onDestroy } from 'svelte';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { slide } from 'svelte/transition';
|
||||
import { alertStore } from '$lib/common/stores.js';
|
||||
export let ms = 3000;
|
||||
let visible = false;
|
||||
let timeout: number;
|
||||
|
||||
window.addEventListener('unhandledrejection', function (promiseRejectionEvent) {
|
||||
$alertStore = promiseRejectionEvent.reason;
|
||||
onMount(async () => {
|
||||
window.addEventListener('unhandledrejection', function (promiseRejectionEvent) {
|
||||
$alertStore = promiseRejectionEvent.reason;
|
||||
});
|
||||
});
|
||||
|
||||
const onMessageChange = (message: string, ms: number) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue