From 384a1d91597622eb59e1c05dc13ce25017c5b6d8 Mon Sep 17 00:00:00 2001 From: roderick <43104791+RodeRickIsWatching@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:17:38 +0800 Subject: [PATCH] fix: default storage invocation (#4480) * fix params of removeItem * Update createStorage.ts * Create breezy-parrots-exist.md --------- Co-authored-by: jxom <7336481+jxom@users.noreply.github.com> --- .changeset/breezy-parrots-exist.md | 8 ++++++++ packages/core/src/createStorage.ts | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .changeset/breezy-parrots-exist.md diff --git a/.changeset/breezy-parrots-exist.md b/.changeset/breezy-parrots-exist.md new file mode 100644 index 0000000000..487e4a30b5 --- /dev/null +++ b/.changeset/breezy-parrots-exist.md @@ -0,0 +1,8 @@ +--- +"@wagmi/core": patch +"wagmi": patch +"@wagmi/vue": patch +"@wagmi/connectors": patch +--- + +Fixed invocation of default storage. diff --git a/packages/core/src/createStorage.ts b/packages/core/src/createStorage.ts index 0f92e0f074..8995ca3202 100644 --- a/packages/core/src/createStorage.ts +++ b/packages/core/src/createStorage.ts @@ -96,8 +96,12 @@ export function getDefaultStorage() { return noopStorage })() return { - getItem: storage.getItem, - removeItem: storage.removeItem, + getItem(key) { + return storage.getItem(key) + }, + removeItem(key) { + storage.removeItem(key) + }, setItem(key, value) { try { storage.setItem(key, value)