mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-04-10 01:15:54 +02: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") ||
|
||||||
key.includes("events/search") ||
|
key.includes("events/search") ||
|
||||||
key.includes("events/explore")),
|
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(() => {
|
.catch(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user