@@ -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 ,
@@ -554,19 +555,23 @@ export const AccountListMenu = ({
554
555
</ Box >
555
556
///: END:ONLY_INCLUDE_IF
556
557
}
557
- { isAddWatchEthereumAccountEnabled && (
558
- < Box marginTop = { 4 } >
559
- < ButtonLink
560
- disabled = { ! isAddWatchEthereumAccountEnabled }
561
- size = { ButtonLinkSize . Sm }
562
- startIconName = { IconName . Eye }
563
- onClick = { handleAddWatchAccount }
564
- data-testid = "multichain-account-menu-popover-add-watch-only-account"
565
- >
566
- { t ( 'addEthereumWatchOnlyAccount' ) }
567
- </ ButtonLink >
568
- </ Box >
569
- ) }
558
+ {
559
+ ///: BEGIN:ONLY_INCLUDE_IF(build-flask)
560
+ isAddWatchEthereumAccountEnabled && (
561
+ < Box marginTop = { 4 } >
562
+ < ButtonLink
563
+ disabled = { ! isAddWatchEthereumAccountEnabled }
564
+ size = { ButtonLinkSize . Sm }
565
+ startIconName = { IconName . Eye }
566
+ onClick = { handleAddWatchAccount }
567
+ data-testid = "multichain-account-menu-popover-add-watch-only-account"
568
+ >
569
+ { t ( 'addEthereumWatchOnlyAccount' ) }
570
+ </ ButtonLink >
571
+ </ Box >
572
+ )
573
+ ///: END:ONLY_INCLUDE_IF
574
+ }
570
575
</ Box >
571
576
) : null }
572
577
{ actionMode === ACTION_MODES . LIST ? (
0 commit comments