fix(catalog): guard group state initialization for ssr
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user