mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-31 00:18:55 +01:00
Update tracked object description optimistically (#14490)
This commit is contained in:
parent
90140e7710
commit
b1285a16c1
@ -321,6 +321,28 @@ function ObjectDetailsTab({
|
||||
(key.includes("events") ||
|
||||
key.includes("events/search") ||
|
||||
key.includes("events/explore")),
|
||||
(currentData: SearchResult[][] | undefined) => {
|
||||
if (!currentData) return currentData;
|
||||
// optimistic update
|
||||
return currentData.map((page) =>
|
||||
page.map((event) =>
|
||||
event.id === search.id
|
||||
? {
|
||||
...event,
|
||||
data: {
|
||||
...event.data,
|
||||
description: desc,
|
||||
},
|
||||
}
|
||||
: event,
|
||||
),
|
||||
);
|
||||
},
|
||||
{
|
||||
optimisticData: true,
|
||||
rollbackOnError: true,
|
||||
revalidate: false,
|
||||
},
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user