Just ignore type errors and use findLast
This commit is contained in:
@@ -157,12 +157,10 @@ function HeaderReady({
|
||||
moderation.ui('displayName'),
|
||||
)
|
||||
|
||||
const latestMessageFromOther = convoState.items
|
||||
.reverse()
|
||||
.find(
|
||||
item =>
|
||||
item.type === 'message' && item.message.sender.did === profile.did,
|
||||
)
|
||||
// @ts-ignore findLast is polyfilled - esb
|
||||
const latestMessageFromOther = convoState.items.findLast(
|
||||
item => item.type === 'message' && item.message.sender.did === profile.did,
|
||||
)
|
||||
|
||||
const latestReportableMessage =
|
||||
latestMessageFromOther?.type === 'message'
|
||||
|
||||
Vendored
+2
-3
@@ -69,9 +69,8 @@ function useMigrateMutes(setThreadMute: SetStateContext) {
|
||||
while (!cancelled) {
|
||||
const threads = persisted.get('mutedThreads')
|
||||
|
||||
const root = threads
|
||||
.reverse()
|
||||
.find(uri => uri.includes(currentAccount.did))
|
||||
// @ts-ignore findLast is polyfilled - esb
|
||||
const root = threads.findLast(uri => uri.includes(currentAccount.did))
|
||||
|
||||
if (!root) break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user