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