File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/lib/components/notification Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 88 import { deleteNotification , resolveNotification } from " $lib/api/notification_api" ;
99 import type { ApiProps } from " $lib/api/api" ;
1010 import { notificationCount } from " $lib/components/notification/notification_store" ;
11+ import { getToaster } from " $lib/context/layout_context.svelte" ;
1112
1213 interface Props {
1314 apiProps: ApiProps
2223 $notificationCount -- ;
2324 }
2425
26+ const toaster = getToaster ()
2527 async function remove() {
26- await deleteNotification (apiProps , notification .id )
27- ondelete ()
28+ const result = await deleteNotification (apiProps , notification .id )
29+ if (result .ok ) ondelete ()
30+ else toaster .error ({title: " Couldn't delete Notification" , description: await result .text ()})
2831 }
2932 </script >
3033
You can’t perform that action at this time.
0 commit comments