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
feat(wallet-template): add account switching #2010
Conversation
keysets: { | ||
[key: string]: any | ||
} | ||
primaryKeysetName: string |
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.
let's default to the first key as primary and remove this key
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.
you still need to store something though. if the user selects an account, then closes the browser, and then re-opens it, the extension should remain on the same account.
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.
you are right.
I wonder if could be stored in window.localStorage
but I'm not sure if that storage is shared between popup and extension pages.
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.
The name needs to be improved because there may be plain accounts that do not have a keyset.
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 can turn keyset into a typed union when we add plain accounts and then have plain accounts as a different variant. then handle each variant when decoded.
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/Accounts.tsx
Outdated
Show resolved
Hide resolved
66e2c7c
to
b51752e
Compare
keysets: { | ||
[key: string]: any | ||
} | ||
primaryKeysetName: string |
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.
you are right.
I wonder if could be stored in window.localStorage
but I'm not sure if that storage is shared between popup and extension pages.
keysets: { | ||
[key: string]: any | ||
} | ||
primaryKeysetName: string |
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.
The name needs to be improved because there may be plain accounts that do not have a keyset.
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/Accounts.tsx
Outdated
Show resolved
Hide resolved
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/Accounts.tsx
Outdated
Show resolved
Hide resolved
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/AddAccount/index.tsx
Outdated
Show resolved
Hide resolved
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/Accounts.tsx
Outdated
Show resolved
Hide resolved
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/AddAccount/index.tsx
Outdated
Show resolved
Hide resolved
daf18ee
to
9dd6087
Compare
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/AddAccount/index.tsx
Outdated
Show resolved
Hide resolved
projects/wallet-template/src/containers/WalletPopup/pages/Accounts/SwitchAccount.tsx
Outdated
Show resolved
Hide resolved
8ef8f65
to
635d080
Compare
#1932