first commit
This commit is contained in:
commit
e687b4437b
418 files changed
+33577
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { router } from '@inertiajs/svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import type { FlashToast } from '@/types/ui';
|
||||
|
||||
export function initializeFlashToast(): void {
|
||||
router.on('flash', (event) => {
|
||||
const flash = (event as CustomEvent).detail?.flash;
|
||||
const data = flash?.toast as FlashToast | undefined;
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
toast[data.type](data.message);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user