mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-21 11:51:53 +03:00
fix object mask default name when created from Explore tracking details
This commit is contained in:
parent
bc5fbe5eba
commit
79ffd7d281
@ -53,6 +53,7 @@ export default function MasksAndZonesView({
|
|||||||
const { data: config } = useSWR<FrigateConfig>("config");
|
const { data: config } = useSWR<FrigateConfig>("config");
|
||||||
const [allPolygons, setAllPolygons] = useState<Polygon[]>([]);
|
const [allPolygons, setAllPolygons] = useState<Polygon[]>([]);
|
||||||
const [editingPolygons, setEditingPolygons] = useState<Polygon[]>([]);
|
const [editingPolygons, setEditingPolygons] = useState<Polygon[]>([]);
|
||||||
|
const [polygonsInitialized, setPolygonsInitialized] = useState(false);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [loadingPolygonIndex, setLoadingPolygonIndex] = useState<
|
const [loadingPolygonIndex, setLoadingPolygonIndex] = useState<
|
||||||
number | undefined
|
number | undefined
|
||||||
@ -609,6 +610,7 @@ export default function MasksAndZonesView({
|
|||||||
...globalObjectMasks,
|
...globalObjectMasks,
|
||||||
...objectMasks,
|
...objectMasks,
|
||||||
]);
|
]);
|
||||||
|
setPolygonsInitialized(true);
|
||||||
// Don't overwrite editingPolygons during editing – layout shifts
|
// Don't overwrite editingPolygons during editing – layout shifts
|
||||||
// from switching to the edit pane can trigger a resize which
|
// from switching to the edit pane can trigger a resize which
|
||||||
// recalculates scaledWidth/scaledHeight and would discard the
|
// recalculates scaledWidth/scaledHeight and would discard the
|
||||||
@ -676,7 +678,7 @@ export default function MasksAndZonesView({
|
|||||||
}, [currentEditingProfile]);
|
}, [currentEditingProfile]);
|
||||||
|
|
||||||
useSearchEffect("object_mask", (coordinates: string) => {
|
useSearchEffect("object_mask", (coordinates: string) => {
|
||||||
if (!scaledWidth || !scaledHeight || isLoading) {
|
if (!scaledWidth || !scaledHeight || isLoading || !polygonsInitialized) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// convert box points string to points array
|
// convert box points string to points array
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user