fix: update cache + timeline when items are updated/deleted (#556)
This commit is contained in:
parent
720b5114af
commit
dc76ab2477
5 changed files with 28 additions and 15 deletions
|
@ -33,11 +33,13 @@ export function useStatusActions(props: StatusActionsProps) {
|
|||
isLoading[action] = true
|
||||
fetchNewStatus().then((newStatus) => {
|
||||
Object.assign(status, newStatus)
|
||||
cacheStatus(newStatus, undefined, true)
|
||||
}).finally(() => {
|
||||
isLoading[action] = false
|
||||
})
|
||||
// Optimistic update
|
||||
status[action] = !status[action]
|
||||
cacheStatus(status, undefined, true)
|
||||
if (countField)
|
||||
status[countField] += status[action] ? 1 : -1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue