Just ignore type errors and use findLast

This commit is contained in:
Eric Bailey
2025-02-06 09:56:24 -06:00
parent fbc30cc326
commit 2ad2219be6
2 changed files with 6 additions and 9 deletions
+4 -6
View File
@@ -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'
+2 -3
View File
@@ -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