Skip to content

a disconnect error by default value or other reason can not set local storage #2227

@logsdk

Description

@logsdk

Current Behavior

1、connect wallet, tips successful
2、discount wallet, error

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at disconnect (index-34745058.js:3597:25)
at async eval (useConnectWallet.js:25:29)

in packages/core/src/disconnect.ts:47

const labels = JSON.parse(getLocalStore(STORAGE_KEYS.LAST_CONNECTED_WALLET) || '');

if can not get last connected wallet, the default value '', can not be parsed by JSON.

Expected Behavior

disconnect wallet successful

Steps To Reproduce

No response

What package is effected by this issue?

@web3-onboard/core

Is this a build or a runtime issue?

Runtime

Package Version

2.22.1

Node Version

No response

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Anything else?

No response

Sanity Check

  • If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions