Reset snapshot state when event is moved

This commit is contained in:
Nicolas Mowen 2024-10-02 07:37:44 -06:00
parent 0126960d79
commit 9823852f98

View File

@ -12,7 +12,7 @@ import {
import { Event } from "@/types/event";
import { FrigateConfig } from "@/types/frigateConfig";
import axios from "axios";
import { useCallback, useMemo, useState } from "react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { isDesktop } from "react-device-detect";
import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
import useSWR from "swr";
@ -62,6 +62,11 @@ export function FrigatePlusDialog({
upload?.plus_id ? "submitted" : "reviewing",
);
useEffect(
() => setState(upload?.plus_id ? "submitted" : "reviewing"),
[upload],
);
const onSubmitToPlus = useCallback(
async (falsePositive: boolean) => {
if (!upload) {