Also update counts even when no new remote content

This commit is contained in:
xmflsct 2023-04-17 22:32:09 +02:00
parent 6ed54c3f16
commit 768a27d37c
1 changed files with 12 additions and 0 deletions

View File

@ -258,6 +258,18 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
}
})
})
} else {
queryClient.cancelQueries(queryKey.local)
queryClient.setQueryData<Mastodon.Status[]>(queryKey.local, old => {
return old?.map(local => {
const remoteMatch = data.find(remote => remote.uri === local.uri)
if (remoteMatch) {
return { ...local, ...updateCounts(remoteMatch) }
} else {
return local
}
})
})
}
},
onSettled: async () => {