diff --git a/CHANGELOG.MD b/CHANGELOG.MD index de70ccf..b9f2b9c 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,5 +1,10 @@ # Change Log +## [Version 1.1.5] + +- improved notification handling and display +- lowerd coinGecko api calls due to recent changes in free tier limit + ## [Version 1.1.4] - minor fix edge case of no notifications diff --git a/src/background/index.ts b/src/background/index.ts index f451012..5ea57e5 100644 --- a/src/background/index.ts +++ b/src/background/index.ts @@ -110,14 +110,15 @@ const alarmHandler = async () => { } catch (error) { console.error('Error fetching profile', error) } + const fiveHours = 18e5 + const isExpiredCoinGecko = store?.settings?.coinGeckoPrice && (new Date().getTime() - store.settings.lastCoinGeckoPriceCheckTimestamp) > fiveHours try { const coinGecko = await requests.coinGecko as Response const coinGeckoJson = await coinGecko.json() const coinGeckoPrice = coinGeckoJson.yup.usd - const store = await getStore() if (store.settings.coinGeckoPrice !== coinGeckoPrice) { - await chrome.storage.local.set({ store: { ...store, settings: { ...store.settings, coinGeckoPrice } } }) + await chrome.storage.local.set({ store: { ...store, settings: { ...store.settings, coinGeckoPrice, lastCoinGeckoPriceCheckTimestamp: new Date().getTime() } } }) } } catch (error) { console.error('Error fetching coinGecko', error) diff --git a/src/components/Notification.svelte b/src/components/Notification.svelte index 99524a8..4c8b3d4 100644 --- a/src/components/Notification.svelte +++ b/src/components/Notification.svelte @@ -13,6 +13,8 @@ const numImages = notif?.senders?.length ?? 0; let loaders: ImgLoader[] = Array(numImages).fill(null); + console.log(notif) + {#if notif.eventType === "vote"} @@ -23,8 +25,8 @@
- by +
+ your post was liked {#if notif?.senders?.length > 1} {notif?.senders[0].handle} {#if notif.senders?.length - 1 > 0} @@ -34,11 +36,11 @@ {notif.senders[0].handle?.length > 12 ? notif.senders[0]?.handle?.slice(0, 12) + "..." : notif.senders[0]?.handle ?? ''} {/if}
-+
extrenalNavigate(`${YUP_APP_BASE}/post/${notif.meta.postid}`)} aria-hidden - class="text-blue-200 interactive-svg">{finalUrl}view the post
@@ -126,6 +128,62 @@ {timeSince(new Date(notif.createdAt))}
extrenalNavigate(`${YUP_APP_BASE}/post/${notif?.meta?.commentId}`)} + > + {sender?.handle || `${sender?._id?.slice(0, 6)}...`} + commented on yout post, click to view. +
++ + {timeSince(new Date(notif.createdAt))} +
+