mirror of
https://github.com/tooot-app/app
synced 2025-05-18 04:25:09 +02:00
Fix error message returning key in poll
This commit is contained in:
parent
88d4de98c2
commit
0dacd5ec89
@ -50,21 +50,22 @@ const TimelinePoll: React.FC = () => {
|
|||||||
},
|
},
|
||||||
onError: (err: any, params) => {
|
onError: (err: any, params) => {
|
||||||
const theParams = params as MutationVarsTimelineUpdateStatusProperty
|
const theParams = params as MutationVarsTimelineUpdateStatusProperty
|
||||||
displayMessage({
|
if (theParams.payload.type === 'poll') {
|
||||||
theme,
|
displayMessage({
|
||||||
type: 'error',
|
theme,
|
||||||
message: t('common:message.error.message', {
|
type: 'error',
|
||||||
// @ts-ignore
|
message: t('common:message.error.message', {
|
||||||
function: t(`componentTimeline:shared.poll.meta.button.${theParams.payload.type}` as any)
|
function: t(`componentTimeline:shared.poll.meta.button.${theParams.payload.action}`)
|
||||||
}),
|
}),
|
||||||
...(err.status &&
|
...(err.status &&
|
||||||
typeof err.status === 'number' &&
|
typeof err.status === 'number' &&
|
||||||
err.data &&
|
err.data &&
|
||||||
err.data.error &&
|
err.data.error &&
|
||||||
typeof err.data.error === 'string' && {
|
typeof err.data.error === 'string' && {
|
||||||
description: err.data.error
|
description: err.data.error
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
}
|
||||||
queryClient.invalidateQueries(queryKey)
|
queryClient.invalidateQueries(queryKey)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user