fix(catalog): guard group state initialization for ssr
This commit is contained in:
@@ -266,8 +266,15 @@ watch(
|
|||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
function getGroupState(group: ProductGroup) {
|
function getGroupState(group: ProductGroup): GroupState {
|
||||||
return groupStates[group.key];
|
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) {
|
function updateField(group: ProductGroup, field: ParamFieldKey, value: ParamValue) {
|
||||||
|
|||||||
Reference in New Issue
Block a user