1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Simplify update toot logic

This commit is contained in:
xmflsct
2023-01-01 18:37:05 +01:00
parent 56d1090ca9
commit 2705b4b804
12 changed files with 114 additions and 310 deletions

View File

@ -35,7 +35,7 @@ const menuStatus = ({
onMutate: true,
onError: (err: any, params, oldData) => {
const theFunction = (params as MutationVarsTimelineUpdateStatusProperty).payload
? (params as MutationVarsTimelineUpdateStatusProperty).payload.property
? (params as MutationVarsTimelineUpdateStatusProperty).payload.type
: 'delete'
displayMessage({
theme,
@ -195,10 +195,9 @@ const menuStatus = ({
type: 'updateStatusProperty',
queryKey,
rootQueryKey,
id: status.id,
status,
payload: {
property: 'muted',
currentValue: status.muted
type: 'muted'
}
}),
disabled: false,
@ -220,12 +219,9 @@ const menuStatus = ({
type: 'updateStatusProperty',
queryKey,
rootQueryKey,
id: status.id,
status,
payload: {
property: 'pinned',
currentValue: status.pinned,
propertyCount: undefined,
countValue: undefined
type: 'pinned'
}
}),
disabled: false,