diff --git a/ui/src/components/Address.svelte b/ui/src/components/Address.svelte index dca0793..7220a19 100644 --- a/ui/src/components/Address.svelte +++ b/ui/src/components/Address.svelte @@ -7,7 +7,7 @@ import { useEntity } from "../lib/entity"; import type { UpObject } from "upend"; import { readable } from "svelte/store"; - import { notify } from "../notifications"; + import { notify, UpNotification } from "../notifications"; const dispatch = createEventDispatcher(); export let address: string; @@ -36,11 +36,14 @@ // Native open function nativeOpen() { - notify.emit("notification", { - content: `Opening ${ - inferredIds[0] || address - } in a default native application...`, - }); + notify.emit( + "notification", + new UpNotification( + `Opening ${ + inferredIds[0] || address + } in a default native application...` + ) + ); fetch(`/api/raw/${address}?native=1`) .then((response) => { if (!response.ok) { @@ -48,10 +51,13 @@ } }) .catch((err) => { - notify.emit("notification", { - content: `Failed to open in native application! (${err})`, - level: "error", - }); + notify.emit( + "notification", + new UpNotification( + `Failed to open in native application! (${err})`, + "error" + ) + ); }); } diff --git a/ui/src/components/Notifications.svelte b/ui/src/components/Notifications.svelte index 5e5dd35..88de91a 100644 --- a/ui/src/components/Notifications.svelte +++ b/ui/src/components/Notifications.svelte @@ -1,26 +1,33 @@ -{#each Object.values(notifications) as notification} -