An ATproto social media client -- with an independent Appview.

chore: sync with upstream

Sync with upstream

authored by

serenity and committed by
GitHub
6c45a757 b4969698

+30 -25
+27 -19
src/components/NewskieDialog.tsx
··· 85 85 const isMe = profile.did === currentAccount?.did 86 86 87 87 const profileName = useMemo(() => { 88 - const name = profile.displayName || profile.handle 88 + if (!moderationOpts) return profile.displayName || profile.handle 89 + const moderation = moderateProfile(profile, moderationOpts) 90 + return sanitizeDisplayName( 91 + profile.displayName || profile.handle, 92 + moderation.ui('displayName'), 93 + ) 94 + }, [moderationOpts, profile]) 95 + 96 + const getJoinMessage = () => { 97 + const timeAgoString = timeAgo(createdAt, now, {format: 'long'}) 89 98 90 99 if (isMe) { 91 - return _(msg`You`) 100 + if (profile.joinedViaStarterPack) { 101 + return _( 102 + msg`You joined Bluesky using a starter pack ${timeAgoString} ago`, 103 + ) 104 + } else { 105 + return _(msg`You joined Bluesky ${timeAgoString} ago`) 106 + } 107 + } else { 108 + if (profile.joinedViaStarterPack) { 109 + return _( 110 + msg`${profileName} joined Bluesky using a starter pack ${timeAgoString} ago`, 111 + ) 112 + } else { 113 + return _(msg`${profileName} joined Bluesky ${timeAgoString} ago`) 114 + } 92 115 } 93 - 94 - if (!moderationOpts) return name 95 - const moderation = moderateProfile(profile, moderationOpts) 96 - 97 - return sanitizeDisplayName(name, moderation.ui('displayName')) 98 - }, [_, isMe, moderationOpts, profile]) 116 + } 99 117 100 118 return ( 101 119 <Dialog.ScrollableInner ··· 122 140 </Text> 123 141 </View> 124 142 <Text style={[a.text_md, a.text_center, a.leading_snug]}> 125 - {profile.joinedViaStarterPack ? ( 126 - <Trans> 127 - {profileName} joined Bluesky using a starter pack{' '} 128 - {timeAgo(createdAt, now, {format: 'long'})} ago 129 - </Trans> 130 - ) : ( 131 - <Trans> 132 - {profileName} joined Bluesky{' '} 133 - {timeAgo(createdAt, now, {format: 'long'})} ago 134 - </Trans> 135 - )} 143 + {getJoinMessage()} 136 144 </Text> 137 145 {profile.joinedViaStarterPack ? ( 138 146 <StarterPackCard.Link
+1 -1
src/lib/hooks/useNotificationHandler.ts
··· 386 386 return payload 387 387 } else { 388 388 if (payload) { 389 - notyLogger.warn('getNotificationPayload: received unknown payload', { 389 + notyLogger.debug('getNotificationPayload: received unknown payload', { 390 390 payload, 391 391 identifier: e.request.identifier, 392 392 })
+2 -5
src/state/queries/notifications/unread.tsx
··· 9 9 10 10 import BroadcastChannel from '#/lib/broadcast' 11 11 import {resetBadgeCount} from '#/lib/notifications/notifications' 12 - import {logger} from '#/logger' 12 + import {useModerationOpts} from '#/state/preferences/moderation-opts' 13 + import {truncateAndInvalidate} from '#/state/queries/util' 13 14 import {useAgent, useSession} from '#/state/session' 14 - import {useModerationOpts} from '../../preferences/moderation-opts' 15 - import {truncateAndInvalidate} from '../util' 16 15 import {RQKEY as RQKEY_NOTIFS} from './feed' 17 16 import {type CachedFeedPage, type FeedPage} from './types' 18 17 import {fetchPage} from './util' ··· 189 188 truncateAndInvalidate(queryClient, RQKEY_NOTIFS('mentions')) 190 189 } 191 190 broadcast.postMessage({event: unreadCountStr}) 192 - } catch (e) { 193 - logger.warn('Failed to check unread notifications', {error: e}) 194 191 } finally { 195 192 isFetchingRef.current = false 196 193 }