mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 01:05:20 +03:00
Fix references to retain
This commit is contained in:
parent
322677e1e0
commit
34ed975d79
@ -117,10 +117,10 @@ export function useDelete() {
|
||||
return deleteEvent;
|
||||
}
|
||||
|
||||
export function useRetain(shouldRetain) {
|
||||
export function useRetain() {
|
||||
const { dispatch, state } = useContext(Api);
|
||||
|
||||
async function retainEvent(eventId) {
|
||||
async function retainEvent(eventId, shouldRetain) {
|
||||
if (!eventId) return null;
|
||||
|
||||
const response = await fetch(`${state.host}/api/events/${eventId}?retain=${shouldRetain}`, { method: 'POST' });
|
||||
|
||||
@ -81,10 +81,12 @@ export default function Event({ eventId, close, scrollRef }) {
|
||||
console.log("handleClickRetain go go go");
|
||||
let success;
|
||||
try {
|
||||
success = await setRetainEvent(eventId);
|
||||
console.log("Trying to send to retain: " + !isRetained)
|
||||
success = await setRetainEvent(eventId, !isRetained);
|
||||
console.log("handleClickRetain result: " + success);
|
||||
|
||||
if (success) {
|
||||
setIsRetained(!isRetained);
|
||||
//setIsRetained(!isRetained);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user