1
0
mirror of https://github.com/tooot-app/app synced 2024-12-22 07:34:06 +01:00

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

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 () => {