aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts/account-list-item.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-12-23 09:17:20 +0800
committerDan Finlay <dan@danfinlay.com>2016-12-23 09:17:20 +0800
commit1f1549904650af2e5502d2d4781a555386dfd084 (patch)
tree0d0f9f5dbe158bf39fe1562b00e3a54ac6d397a7 /ui/app/accounts/account-list-item.js
parenta10fe6b6f4217b3984f861bb8ad69d075f672872 (diff)
downloadtangerine-wallet-browser-1f1549904650af2e5502d2d4781a555386dfd084.tar.gz
tangerine-wallet-browser-1f1549904650af2e5502d2d4781a555386dfd084.tar.zst
tangerine-wallet-browser-1f1549904650af2e5502d2d4781a555386dfd084.zip
Show a "LOOSE" warning on accounts not belonging to HD Seed phrase
Diffstat (limited to 'ui/app/accounts/account-list-item.js')
-rw-r--r--ui/app/accounts/account-list-item.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/ui/app/accounts/account-list-item.js b/ui/app/accounts/account-list-item.js
index ef7b749e4..624e34581 100644
--- a/ui/app/accounts/account-list-item.js
+++ b/ui/app/accounts/account-list-item.js
@@ -15,19 +15,21 @@ function AccountListItem () {
}
AccountListItem.prototype.render = function () {
- const identity = this.props.identity
- var isSelected = this.props.selectedAccount === identity.address
- var account = this.props.accounts[identity.address]
+ const { identity, selectedAccount, accounts, onShowDetail } = this.props
+
+ const isSelected = selectedAccount === identity.address
+ const account = accounts[identity.address]
const selectedClass = isSelected ? '.selected' : ''
return (
h(`.accounts-list-option.flex-row.flex-space-between.pointer.hover-white${selectedClass}`, {
key: `account-panel-${identity.address}`,
- onClick: (event) => this.props.onShowDetail(identity.address, event),
+ onClick: (event) => onShowDetail(identity.address, event),
}, [
h('.identicon-wrapper.flex-column.flex-center.select-none', [
this.pendingOrNot(),
+ this.indicateIfLoose(),
h(Identicon, {
address: identity.address,
imageify: true,
@@ -70,6 +72,14 @@ AccountListItem.prototype.render = function () {
)
}
+AccountListItem.prototype.indicateIfLoose = function () {
+ try { // Sometimes keyrings aren't loaded yet:
+ const type = this.props.keyring.type
+ const isLoose = type !== 'HD Key Tree'
+ return isLoose ? h('.pending-dot', 'LOOSE') : null
+ } catch (e) { return }
+}
+
AccountListItem.prototype.pendingOrNot = function () {
const pending = this.props.pending
if (pending.length === 0) return null