fix: fix the issue where the input field was empty when there was no friendly_name

This commit is contained in:
ZhaiSoul 2025-11-04 12:54:36 +00:00
parent 2339b5f35d
commit 894f9d06dd
2 changed files with 2 additions and 2 deletions

View File

@ -270,7 +270,7 @@ export function PolygonCanvas({
const activePolygon = updatedPolygons[activePolygonIndex];
// add default points order for already completed polygons
if (!activePolygon.pointsOrder && activePolygon.isFinished) {
if (!activePolygon?.pointsOrder && activePolygon?.isFinished) {
updatedPolygons[activePolygonIndex] = {
...activePolygon,
pointsOrder: activePolygon.points.map((_, index) => index),

View File

@ -271,7 +271,7 @@ export default function ZoneEditPane({
mode: "onBlur",
defaultValues: {
name: polygon?.name ?? "",
friendly_name: polygon?.friendly_name ?? "",
friendly_name: polygon?.friendly_name ?? polygon?.name,
inertia:
polygon?.camera &&
polygon?.name &&