feat: add removing admins

This commit is contained in:
Xyphyn committed 2023-08-28 16:02:18 -07:00
1 parent 41a8c1a1f0
commit 9d0694f138
3 files changed
+39 -79

No files matched your search

+13
View File
@@ -1,4 +1,5 @@
import { goto } from '$app/navigation'
import { toast } from '$lib/components/ui/toasts/toasts.js'
import { userSettings } from '$lib/settings.js'
import { get } from 'svelte/store'
@@ -81,3 +82,15 @@ export function moveItem<T>(
return newArray
}
type Maybe<T> = T | undefined | void | null
export const trycatch = <T>(func: () => T): Maybe<T> => {
try {
return func()
} catch (err) {
toast({
content: err as any,
type: 'error',
})
}
}