refactor: add and use isValidCatalogLayout type guard for robust layout assignment
This commit is contained in:
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,
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user