make error toast global in admin routes

This commit is contained in:
2023-10-04 14:28:35 +02:00
parent 8a80b0a9e0
commit 85597585da
5 changed files with 28 additions and 15 deletions

View File

@@ -4,5 +4,16 @@ import { writable } from 'svelte/store';
export const playAudio: Writable<boolean> = persisted('playAudio', false);
export const errorMessage: Writable<string | null> = (() => {
const store: Writable<string | null> = writable(null);
return {
subscribe: store.subscribe,
set: (value) => {
if (value != null) store.set(null);
store.set(value);
},
update: store.update
};
})();
export const reportCount: Writable<number> = writable(0);
export const adminCount: Writable<number> = writable(0);