mirror of
https://github.com/tooot-app/app
synced 2025-01-03 13:10:23 +01:00
Also update counts even when no new remote content
This commit is contained in:
parent
6ed54c3f16
commit
768a27d37c
@ -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 () => {
|
onSettled: async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user