-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: local storage keys to appkit + network switch fixes #2861
Conversation
🦋 Changeset detectedLatest commit: 1eb7feb The changes in this PR will be included in the next version bump. This PR includes changesets to release 34 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
♻️ Vite-Size ♻️Size Difference
Current Size
Base Size
|
@@ -24,7 +32,7 @@ export const SafeLocalStorage = { | |||
value: SafeLocalStorageItems[Key] | |||
): void { | |||
if (isSafe()) { | |||
localStorage.setItem(key, JSON.stringify(value)) | |||
localStorage.setItem(key, value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't do the parsing here. An example;
We have @appkit/active_caip_network
key, which is expected to store CaipNetwork
type.
If we set '@appkit/active_caip_network': string
on SafeLocalStorageItems
, the getItem
's catch
will return type error bc, if somehow the parsing fails, it'll return string
which is not what that key stores.
So the stringify
ing and parse
ing should be abstracted from this SafeLocalStorage
utility.
…or/local-storage-keys-to-appkit-2
@enesozturk @tomiir @zoruka are you going to add some logic to migrate from old keys to new ones? If not, i think you'll probably mess some connections from dapps migrating from the old sdk to the new one |
I think old connections will fail to parse when attempted to read the values in the |
…or/local-storage-keys-to-appkit-2
…WalletConnect/web3modal into refactor/local-storage-keys-to-appkit-2
Description
Switched to
@appkit/*
prefix for the local storage keys.Type of change
Associated Issues
For Linear issues: Closes APKT-xxx
For GH issues: closes #...
Showcase (Optional)
If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.
Checklist