* 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>
This commit is contained in:
Josh Soref 2023-05-30 15:46:43 -04:00 committed by GitHub
parent 724951e2f0
commit c808721938
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 48 additions and 41 deletions

View file

@ -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)
}

View file

@ -11,7 +11,7 @@ export function getCurrentRoute(state: State) {
export function isStateAtTabRoot(state: State | undefined) {
if (!state) {
// NOTE
// if state is not defined it's because init is occuring
// if state is not defined it's because init is occurring
// and therefore we can safely assume we're at root
// -prf
return true

View file

@ -27,7 +27,7 @@ export function detectLinkables(text: string): DetectedLinkable[] {
matchValue = matchValue.slice(1)
}
// strip ending puncuation
// strip ending punctuation
if (/[.,;!?]$/.test(matchValue)) {
matchValue = matchValue.slice(0, -1)
}