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