mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Updates
This commit is contained in:
@ -242,8 +242,16 @@ export type MutationVarsTimelineUpdateStatusProperty = {
|
||||
reblog?: boolean
|
||||
payload:
|
||||
| {
|
||||
property: 'bookmarked' | 'favourited' | 'muted' | 'pinned' | 'reblogged'
|
||||
property: 'bookmarked' | 'muted' | 'pinned'
|
||||
currentValue: boolean
|
||||
propertyCount: undefined
|
||||
countValue: undefined
|
||||
}
|
||||
| {
|
||||
property: 'favourited' | 'reblogged'
|
||||
currentValue: boolean
|
||||
propertyCount: 'favourites_count' | 'reblogs_count'
|
||||
countValue: number
|
||||
}
|
||||
| {
|
||||
property: 'poll'
|
||||
|
@ -19,6 +19,13 @@ const updateConversation = ({
|
||||
typeof payload.currentValue === 'boolean'
|
||||
? !payload.currentValue
|
||||
: true
|
||||
if (payload.propertyCount) {
|
||||
if (typeof payload.currentValue === 'boolean' && payload.currentValue) {
|
||||
item.last_status[payload.propertyCount] = payload.countValue - 1
|
||||
} else {
|
||||
item.last_status[payload.propertyCount] = payload.countValue + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
@ -16,6 +16,13 @@ const updateNotification = ({
|
||||
typeof payload.currentValue === 'boolean'
|
||||
? !payload.currentValue
|
||||
: true
|
||||
if (payload.propertyCount) {
|
||||
if (typeof payload.currentValue === 'boolean' && payload.currentValue) {
|
||||
item.status[payload.propertyCount] = payload.countValue - 1
|
||||
} else {
|
||||
item.status[payload.propertyCount] = payload.countValue + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
@ -23,11 +23,25 @@ const updateStatus = ({
|
||||
typeof payload.currentValue === 'boolean'
|
||||
? !payload.currentValue
|
||||
: true
|
||||
if (payload.propertyCount) {
|
||||
if (typeof payload.currentValue === 'boolean' && payload.currentValue) {
|
||||
item.reblog![payload.propertyCount] = payload.countValue - 1
|
||||
} else {
|
||||
item.reblog![payload.propertyCount] = payload.countValue + 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
item[payload.property] =
|
||||
typeof payload.currentValue === 'boolean'
|
||||
? !payload.currentValue
|
||||
: true
|
||||
if (payload.propertyCount) {
|
||||
if (typeof payload.currentValue === 'boolean' && payload.currentValue) {
|
||||
item[payload.propertyCount] = payload.countValue - 1
|
||||
} else {
|
||||
item[payload.propertyCount] = payload.countValue + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
Reference in New Issue
Block a user