Agoric / dapp-inter

User application for Agoric Inter Protocol—Vaults, BLD Boost, Liquidations, etc.
2 stars 10 forks source link

Default view for vault holder after wallet connection is 'Create a Vault' not 'My Vaults' #82

Closed otoole-brendan closed 1 year ago

otoole-brendan commented 1 year ago

What is the Problem Being Solved?

Currently after a user creates a vault, when they relaunch Vaults UI and connect their wallet, their default view is 'Create a Vault'. Once we detect they have a vault opened, their default view should be 'My Vaults' as user is likely to see vault overview rather than want to open a new vault upon returning.

Description of the Design

Detect if user has open vault upon wallet connection. If yes -> take user to 'My Vaults' view. If No -> default view is 'Create Vault' view.

Security Considerations

Unknown

Test Plan

Will be smoke-tested

otoole-brendan commented 1 year ago

@samsiegart I vaguely recall us briefly discussing this - were there some issues with this approach?

samsiegart commented 1 year ago

@samsiegart I vaguely recall us briefly discussing this - were there some issues with this approach?

It might be unexpected for the view to change on the user after they connect their wallet. We could instead use local storage to remember: (a) If they've created a vault before, and (b) If they've connected their wallet before. Then, when they visit the page:

If they open a new ipfs url or switch devices the local storage won't work the first time, though. If that happens too often, maybe we could see if the view changing after connecting the wallet isn't too intrusive.