Skip to content

Commit 87fe8a9

Browse files
committed
fixed localStorage issue
1 parent f55fb7f commit 87fe8a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/packages/lowcoder/src/comps/hooks/localStorageComp.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ LocalStorageComp = withMethodExposing(LocalStorageComp, [
6161
const parseStore = JSON.parse(originStore);
6262
parseStore[key] = value;
6363
localStorage.setItem(APP_STORE_NAMESPACE, JSON.stringify(parseStore));
64+
comp.children.values.dispatchChangeValueAction(parseStore);
6465
} catch (e) {
6566
localStorage.setItem(APP_STORE_NAMESPACE, "{}");
6667
}
@@ -81,6 +82,7 @@ LocalStorageComp = withMethodExposing(LocalStorageComp, [
8182
const parseStore = JSON.parse(originStore);
8283
delete parseStore[key];
8384
localStorage.setItem(APP_STORE_NAMESPACE, JSON.stringify(parseStore));
85+
comp.children.values.dispatchChangeValueAction(parseStore);
8486
} catch (e) {
8587
localStorage.setItem(APP_STORE_NAMESPACE, "{}");
8688
}
@@ -93,8 +95,9 @@ LocalStorageComp = withMethodExposing(LocalStorageComp, [
9395
description: trans("localStorageComp.clearItemDesc"),
9496
params: [],
9597
},
96-
execute: () => {
98+
execute: (comp) => {
9799
localStorage.removeItem(APP_STORE_NAMESPACE);
100+
comp.children.values.dispatchChangeValueAction({});
98101
},
99102
},
100103
]);

0 commit comments

Comments
 (0)