fix(catalog): guard group state initialization for ssr

This commit is contained in:
Ruslan Bakiev
2026-04-03 12:24:03 +07:00
parent f977896647
commit 084fc44f9c

View File

@@ -266,8 +266,15 @@ watch(
{ immediate: true },
);
function getGroupState(group: ProductGroup) {
return groupStates[group.key];
function getGroupState(group: ProductGroup): GroupState {
const existing = groupStates[group.key];
if (existing) {
return existing;
}
const created = createGroupState(group);
groupStates[group.key] = created;
return created;
}
function updateField(group: ProductGroup, field: ParamFieldKey, value: ParamValue) {