mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

A couple notifications fixes (#2327)

* Clear the app badge notif count on markallread

* Fix like notifications on custom feeds

authored by

Paul Frazee and committed by
GitHub
6e001dbf 3b240db0

+22 -3
+3
src/state/queries/notifications/unread.tsx
··· 89 89 // update & broadcast 90 90 setNumUnread('') 91 91 broadcast.postMessage({event: ''}) 92 + if (isNative) { 93 + Notifications.setBadgeCountAsync(0) 94 + } 92 95 }, 93 96 94 97 async checkUnread({invalidate}: {invalidate?: boolean} = {}) {
+3 -1
src/state/queries/notifications/util.ts
··· 156 156 ): Promise<Map<string, AppBskyFeedDefs.PostView>> { 157 157 const uris = new Set<string>() 158 158 for (const notif of groupedNotifs) { 159 - if (notif.subjectUri) { 159 + if (notif.subjectUri && !notif.subjectUri.includes('feed.generator')) { 160 160 uris.add(notif.subjectUri) 161 161 } 162 162 } ··· 216 216 ? notif.record.subject?.uri 217 217 : undefined 218 218 } 219 + } else if (type === 'feedgen-like') { 220 + return notif.reasonSubject 219 221 } 220 222 } 221 223
+16 -2
src/view/com/notifications/FeedItem.tsx
··· 42 42 import {isWeb} from 'platform/detection' 43 43 import {Trans, msg} from '@lingui/macro' 44 44 import {useLingui} from '@lingui/react' 45 + import {FeedSourceCard} from '../feeds/FeedSourceCard' 45 46 46 47 const MAX_AUTHORS = 5 47 48 ··· 112 113 ] 113 114 }, [item, moderationOpts]) 114 115 115 - if (item.subjectUri && !item.subject) { 116 + if (item.subjectUri && !item.subject && item.type !== 'feedgen-like') { 116 117 // don't render anything if the target post was deleted or unfindable 117 118 return <View /> 118 119 } ··· 166 167 iconStyle = [s.blue3 as FontAwesomeIconStyle] 167 168 } else if (item.type === 'feedgen-like') { 168 169 action = `liked your custom feed${ 169 - item.subjectUri ? ` '${new AtUri(item.subjectUri).rkey}}'` : '' 170 + item.subjectUri ? ` '${new AtUri(item.subjectUri).rkey}'` : '' 170 171 }` 171 172 icon = 'HeartIconSolid' 172 173 iconStyle = [ ··· 255 256 </ExpandListPressable> 256 257 {item.type === 'post-like' || item.type === 'repost' ? ( 257 258 <AdditionalPostText post={item.subject} /> 259 + ) : null} 260 + {item.type === 'feedgen-like' && item.subjectUri ? ( 261 + <FeedSourceCard 262 + feedUri={item.subjectUri} 263 + style={[pal.view, pal.border, styles.feedcard]} 264 + showLikes 265 + /> 258 266 ) : null} 259 267 </View> 260 268 </Link> ··· 495 503 marginTop: 5, 496 504 marginLeft: 2, 497 505 opacity: 0.8, 506 + }, 507 + feedcard: { 508 + borderWidth: 1, 509 + borderRadius: 8, 510 + paddingVertical: 12, 511 + marginTop: 6, 498 512 }, 499 513 500 514 addedContainer: {