Closed bcowell closed 2 years ago
Also the status should likely be 'disconnected' after firing the cleanup versus 'idle' to differentiate the two
If you refresh the page, the JS state is reset, so it's the expected behavior. The viewer ID is persisted by cookie so it can be used for read-only access, but any authentication state is lost on page refresh.
Description
Connecting a wallet using the useViewerConnection hook and a Provider. Refreshing the page, the connection of useViewerConnection never tries to re-connect.
Isn't this hook supposed to handle this connection lifecycle? My metamask wallet continues to say it's connected. And the useViewerID hook still properly pulls my id after refresh.
Result:
useViewerConnection.connect
a. This works and connection status returns{ status: 'connected', selfID: SelfID }
. Cookies, etc. are set.useViewerConnection.connection
is{ status: 'idle' }
Expected:
useViewerConnection.connect
a. This works and connection status returns{status: 'connected', selfID: SelfID}
. Cookies, etc. are set.useViewerConnection.connection
returns{status: 'connected', selfID: SelfID}
Technical Information
Version
@self.id/framework: ^0.3.2
Re-calling connect puts some info into localStorage under 3idconnect.org - this is wiped on refreshExample