From d0ac7b2d62b46535d5b74aeb7ea08cde2cd4617d Mon Sep 17 00:00:00 2001 From: Zhichao Zhang Date: Thu, 16 Mar 2023 15:22:45 +0800 Subject: [PATCH] deserialize value when get all items --- .changeset/nasty-cows-act.md | 5 +++++ packages/ui-store/src/store/utils.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/nasty-cows-act.md diff --git a/.changeset/nasty-cows-act.md b/.changeset/nasty-cows-act.md new file mode 100644 index 0000000..a37f477 --- /dev/null +++ b/.changeset/nasty-cows-act.md @@ -0,0 +1,5 @@ +--- +"@zcloak/ui-store": patch +--- + +deserialize value when get all items diff --git a/packages/ui-store/src/store/utils.ts b/packages/ui-store/src/store/utils.ts index 1f0986f..129a612 100644 --- a/packages/ui-store/src/store/utils.ts +++ b/packages/ui-store/src/store/utils.ts @@ -26,7 +26,7 @@ export function getAllItems(storage: Storage): Map { const key = storage.key(i); if (key) { - items.set(key, storage.getItem(key)); + items.set(key, deserialize(storage.getItem(key))); } }