refactor: add and use isValidCatalogLayout type guard for robust layout assignment
CI / check (push) Successful in 2m35s
CI / deploy (push) Successful in 1m19s
CI / publish-container (push) Successful in 50s

This commit is contained in:
openhands committed 2026-09-11 23:28:22 +02:00
1 parent 683fee3bd9
commit 669e20a35c
2 files changed
+13 -2

No files matched your search

@@ -34,7 +34,11 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { CATALOG_LAYOUTS, type CatalogLayout } from "@/lib/catalog-layouts";
import {
CATALOG_LAYOUTS,
type CatalogLayout,
isValidCatalogLayout,
} from "@/lib/catalog-layouts";
// import { CATALOG_LAYOUTS } from "@/lib/catalog-layouts";
import { getLocalIconUrl } from "@/lib/furni/classname";
import { cn } from "@/lib/utils";
@@ -745,7 +749,9 @@ export function OrganizeImportsDialog({
layout:
group.layout === null
? undefined
: (group.layout as CatalogLayout),
: isValidCatalogLayout(group.layout)
? group.layout
: undefined,
});
}}
>