about summary refs log tree commit diff
path: root/src/lib/notifee.ts
diff options
context:
space:
mode:
authorJosh Soref <2119212+jsoref@users.noreply.github.com>2023-05-30 15:46:43 -0400
committerGitHub <noreply@github.com>2023-05-30 14:46:43 -0500
commitc8087219381c72233af7aef3bfd60fc587d479c4 (patch)
treedc8318ae876d671bc08c84b9cb21949e610d5e02 /src/lib/notifee.ts
parent724951e2f0bfe5e9ec4d8f2bb81f6aeca98e783b (diff)
downloadvoidsky-c8087219381c72233af7aef3bfd60fc587d479c4.tar.zst
Spelling (#772)
* spelling: account

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: activated

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: additional

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: appropriate

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: bskyweb

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: description

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: display

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: highlighted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: javascript

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: locally-hosted

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: notification

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: occurring

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: parenthetical

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: preexisting

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: prefetched

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: punctuation

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* spelling: simplicity

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

---------

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Diffstat (limited to 'src/lib/notifee.ts')
-rw-r--r--src/lib/notifee.ts30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/notifee.ts b/src/lib/notifee.ts
index 866319031..42feb01c6 100644
--- a/src/lib/notifee.ts
+++ b/src/lib/notifee.ts
@@ -41,26 +41,26 @@ export function displayNotification(
 }
 
 export function displayNotificationFromModel(
-  notif: NotificationsFeedItemModel,
+  notification: NotificationsFeedItemModel,
 ) {
   let author = sanitizeDisplayName(
-    notif.author.displayName || notif.author.handle,
+    notification.author.displayName || notification.author.handle,
   )
   let title: string
   let body: string = ''
-  if (notif.isLike) {
+  if (notification.isLike) {
     title = `${author} liked your post`
-    body = notif.additionalPost?.thread?.postRecord?.text || ''
-  } else if (notif.isRepost) {
+    body = notification.additionalPost?.thread?.postRecord?.text || ''
+  } else if (notification.isRepost) {
     title = `${author} reposted your post`
-    body = notif.additionalPost?.thread?.postRecord?.text || ''
-  } else if (notif.isMention) {
+    body = notification.additionalPost?.thread?.postRecord?.text || ''
+  } else if (notification.isMention) {
     title = `${author} mentioned you`
-    body = notif.additionalPost?.thread?.postRecord?.text || ''
-  } else if (notif.isReply) {
+    body = notification.additionalPost?.thread?.postRecord?.text || ''
+  } else if (notification.isReply) {
     title = `${author} replied to your post`
-    body = notif.additionalPost?.thread?.postRecord?.text || ''
-  } else if (notif.isFollow) {
+    body = notification.additionalPost?.thread?.postRecord?.text || ''
+  } else if (notification.isFollow) {
     title = 'New follower!'
     body = `${author} has followed you`
   } else {
@@ -68,10 +68,12 @@ export function displayNotificationFromModel(
   }
   let image
   if (
-    AppBskyEmbedImages.isView(notif.additionalPost?.thread?.post.embed) &&
-    notif.additionalPost?.thread?.post.embed.images[0]?.thumb
+    AppBskyEmbedImages.isView(
+      notification.additionalPost?.thread?.post.embed,
+    ) &&
+    notification.additionalPost?.thread?.post.embed.images[0]?.thumb
   ) {
-    image = notif.additionalPost.thread.post.embed.images[0].thumb
+    image = notification.additionalPost.thread.post.embed.images[0].thumb
   }
   return displayNotification(title, body, image)
 }