@@ -60,14 +60,14 @@ import {
60
60
getIsAddSnapAccountEnabled ,
61
61
///: END:ONLY_INCLUDE_IF
62
62
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
63
+ getIsWatchEthereumAccountEnabled ,
63
64
getIsBitcoinSupportEnabled ,
64
65
getIsBitcoinTestnetSupportEnabled ,
65
66
///: END:ONLY_INCLUDE_IF
66
67
getMetaMaskAccountsOrdered ,
67
68
getOriginOfCurrentTab ,
68
69
getSelectedInternalAccount ,
69
70
getUpdatedAndSortedAccounts ,
70
- getIsWatchEthereumAccountEnabled ,
71
71
} from '../../../selectors' ;
72
72
import { setSelectedAccount } from '../../../store/actions' ;
73
73
import {
@@ -87,6 +87,12 @@ import { getEnvironmentType } from '../../../../app/scripts/lib/util';
87
87
import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app' ;
88
88
import { getAccountLabel } from '../../../helpers/utils/accounts' ;
89
89
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
90
+ import {
91
+ ACCOUNT_WATCHER_NAME ,
92
+ ACCOUNT_WATCHER_SNAP_ID ,
93
+ // TODO: Remove restricted import
94
+ // eslint-disable-next-line import/no-restricted-paths
95
+ } from '../../../../app/scripts/lib/snap-keyring/account-watcher-snap' ;
90
96
import {
91
97
hasCreatedBtcMainnetAccount ,
92
98
hasCreatedBtcTestnetAccount ,
@@ -100,12 +106,6 @@ import {
100
106
MergedInternalAccount ,
101
107
} from '../../../selectors/selectors.types' ;
102
108
import { trace , endTrace , TraceName } from '../../../../shared/lib/trace' ;
103
- import {
104
- ACCOUNT_WATCHER_NAME ,
105
- ACCOUNT_WATCHER_SNAP_ID ,
106
- // TODO: Remove restricted import
107
- // eslint-disable-next-line import/no-restricted-paths
108
- } from '../../../../app/scripts/lib/snap-keyring/account-watcher-snap' ;
109
109
import { HiddenAccountList } from './hidden-account-list' ;
110
110
111
111
const ACTION_MODES = {
@@ -115,9 +115,9 @@ const ACTION_MODES = {
115
115
MENU : 'menu' ,
116
116
// Displays the add account form controls
117
117
ADD : 'add' ,
118
+ ///: BEGIN:ONLY_INCLUDE_IF(build-flask)
118
119
// Displays the add account form controls (for watch-only account)
119
120
ADD_WATCH_ONLY : 'add-watch-only' ,
120
- ///: BEGIN:ONLY_INCLUDE_IF(build-flask)
121
121
// Displays the add account form controls (for bitcoin account)
122
122
ADD_BITCOIN : 'add-bitcoin' ,
123
123
// Same but for testnet
@@ -141,9 +141,9 @@ export const getActionTitle = (
141
141
switch ( actionMode ) {
142
142
case ACTION_MODES . ADD :
143
143
case ACTION_MODES . MENU :
144
- case ACTION_MODES . ADD_WATCH_ONLY :
145
144
return t ( 'addAccount' ) ;
146
145
///: BEGIN:ONLY_INCLUDE_IF(build-flask)
146
+ case ACTION_MODES . ADD_WATCH_ONLY :
147
147
case ACTION_MODES . ADD_BITCOIN :
148
148
return t ( 'addAccount' ) ;
149
149
case ACTION_MODES . ADD_BITCOIN_TESTNET :
@@ -237,6 +237,7 @@ export const AccountListMenu = ({
237
237
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
238
238
const addSnapAccountEnabled = useSelector ( getIsAddSnapAccountEnabled ) ;
239
239
///: END:ONLY_INCLUDE_IF
240
+ ///: BEGIN:ONLY_INCLUDE_IF(build-flask)
240
241
const isAddWatchEthereumAccountEnabled = useSelector (
241
242
getIsWatchEthereumAccountEnabled ,
242
243
) ;
@@ -254,7 +255,7 @@ export const AccountListMenu = ({
254
255
onClose ( ) ;
255
256
history . push ( `/snaps/view/${ encodeURIComponent ( ACCOUNT_WATCHER_SNAP_ID ) } ` ) ;
256
257
} , [ trackEvent , onClose , history ] ) ;
257
- ///: BEGIN:ONLY_INCLUDE_IF(build-flask)
258
+
258
259
const bitcoinSupportEnabled = useSelector ( getIsBitcoinSupportEnabled ) ;
259
260
const bitcoinTestnetSupportEnabled = useSelector (
260
261
getIsBitcoinTestnetSupportEnabled ,
@@ -552,19 +553,23 @@ export const AccountListMenu = ({
552
553
</ Box >
553
554
///: END:ONLY_INCLUDE_IF
554
555
}
555
- { isAddWatchEthereumAccountEnabled && (
556
- < Box marginTop = { 4 } >
557
- < ButtonLink
558
- disabled = { ! isAddWatchEthereumAccountEnabled }
559
- size = { ButtonLinkSize . Sm }
560
- startIconName = { IconName . Eye }
561
- onClick = { handleAddWatchAccount }
562
- data-testid = "multichain-account-menu-popover-add-watch-only-account"
563
- >
564
- { t ( 'addEthereumWatchOnlyAccount' ) }
565
- </ ButtonLink >
566
- </ Box >
567
- ) }
556
+ {
557
+ ///: BEGIN:ONLY_INCLUDE_IF(build-flask)
558
+ isAddWatchEthereumAccountEnabled && (
559
+ < Box marginTop = { 4 } >
560
+ < ButtonLink
561
+ disabled = { ! isAddWatchEthereumAccountEnabled }
562
+ size = { ButtonLinkSize . Sm }
563
+ startIconName = { IconName . Eye }
564
+ onClick = { handleAddWatchAccount }
565
+ data-testid = "multichain-account-menu-popover-add-watch-only-account"
566
+ >
567
+ { t ( 'addEthereumWatchOnlyAccount' ) }
568
+ </ ButtonLink >
569
+ </ Box >
570
+ )
571
+ ///: END:ONLY_INCLUDE_IF
572
+ }
568
573
</ Box >
569
574
) : null }
570
575
{ actionMode === ACTION_MODES . LIST ? (
0 commit comments