Fixed resendCarParts label_fa's + OTP

This commit is contained in:
SepehrYahyaee
2026-05-25 14:13:17 +03:30
parent 64fa560f73
commit 680f3c1798
10 changed files with 435 additions and 84 deletions

View File

@@ -301,6 +301,19 @@ export function normalizeDamageSelectedParts(
}
if (typeof el === "object") {
const o = el as Record<string, unknown>;
const idOnly = toNum(o.id);
const hasName = typeof o.name === "string" && o.name.trim();
const hasKey = typeof o.key === "string" && String(o.key).trim();
if (idOnly != null && !hasName && !hasKey) {
let catItem: OuterPartCatalogItem | undefined;
if (catalog) catItem = catalog.find((c) => c.id === idOnly);
if (!catItem) catItem = CATALOG_ITEM_BY_ID.get(idOnly);
if (catItem) {
const list = catalog ?? outerCatalogListForItem(catItem);
out.push(catalogItemToSelectedPart(catItem, list));
continue;
}
}
if (typeof o.name === "string" && o.name.trim()) {
let name = o.name.trim();
const inner = splitCatalogKeyToNameAndSide(name);