From 68bbb0d095513a9db92400dd9fbc2bc59da7e420 Mon Sep 17 00:00:00 2001
From: Andrei O
Date: Wed, 8 Nov 2023 23:54:11 +0200
Subject: [PATCH] chore: changes for `1.1.4`
---
src/components/Notification.svelte | 6 +++---
src/pages/Notifications.svelte | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/components/Notification.svelte b/src/components/Notification.svelte
index 09112fa..99524a8 100644
--- a/src/components/Notification.svelte
+++ b/src/components/Notification.svelte
@@ -16,7 +16,7 @@
{#if notif.eventType === "vote"}
- {@const url = notif.meta.url}
+ {@const url = notif?.meta?.url ?? ''}
{@const length = url.length}
{@const shortUrl = url.slice(0, 10) + "..." + url.slice(length - 10, length)}
{@const finalUrl = length > 24 ? shortUrl : url}
@@ -27,11 +27,11 @@
by
{#if notif?.senders?.length > 1}
{notif?.senders[0].handle}
- {#if notif.senders.length - 1 > 0}
+ {#if notif.senders?.length - 1 > 0}
and {notif.senders.length - 1} more
{/if}
{:else}
- {notif.senders[0].handle.length > 12 ? notif.senders[0].handle.slice(0, 12) + "..." : notif.senders[0].handle}
+ {notif.senders[0].handle?.length > 12 ? notif.senders[0]?.handle?.slice(0, 12) + "..." : notif.senders[0]?.handle ?? ''}
{/if}
diff --git a/src/pages/Notifications.svelte b/src/pages/Notifications.svelte
index 268263f..5e267b4 100644
--- a/src/pages/Notifications.svelte
+++ b/src/pages/Notifications.svelte
@@ -51,7 +51,7 @@ const changeNotifsType = async (t : string[] | null) => {
{#if loading}
-{:else if notifs.length === 0}
+{:else if (notifs ?? []).length === 0}
{#await pastNotifsPromise}