mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-07 14:04:10 +03:00
fix: fix the logical error in the null/empty check for the polygons parameter
This commit is contained in:
parent
303ebff4e3
commit
54f228fb6f
@ -262,7 +262,7 @@ export function PolygonCanvas({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (activePolygonIndex === undefined || !polygons) {
|
if (activePolygonIndex === undefined || !polygons?.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ export function PolygonCanvas({
|
|||||||
const activePolygon = updatedPolygons[activePolygonIndex];
|
const activePolygon = updatedPolygons[activePolygonIndex];
|
||||||
|
|
||||||
// add default points order for already completed polygons
|
// add default points order for already completed polygons
|
||||||
if (!activePolygon?.pointsOrder && activePolygon?.isFinished) {
|
if (!activePolygon.pointsOrder && activePolygon.isFinished) {
|
||||||
updatedPolygons[activePolygonIndex] = {
|
updatedPolygons[activePolygonIndex] = {
|
||||||
...activePolygon,
|
...activePolygon,
|
||||||
pointsOrder: activePolygon.points.map((_, index) => index),
|
pointsOrder: activePolygon.points.map((_, index) => index),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user