1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Cannot use pure component in this case after refresh
This commit is contained in:
Zhiyuan Zheng
2021-03-25 00:25:37 +01:00
parent 3727f0e252
commit f3852025ba
10 changed files with 274 additions and 285 deletions

View File

@ -45,7 +45,6 @@ const TimelinePoll: React.FC<Props> = ({
const queryClient = useQueryClient()
const mutation = useTimelineMutation({
queryClient,
onSuccess: ({ body }, params) => {
const theParams = params as MutationVarsTimelineUpdateStatusProperty
queryClient.cancelQueries(queryKey)
@ -55,7 +54,7 @@ const TimelinePoll: React.FC<Props> = ({
switch (theParams.payload.property) {
case 'poll':
theParams.payload.data = (body as unknown) as Mastodon.Poll
updateStatusProperty({ queryClient, ...theParams })
updateStatusProperty(theParams)
break
}
},