@@ -114,6 +114,10 @@ import NetworkConfirmationPopover from '../../components/multichain/network-list
114
114
import NftFullImage from '../../components/app/assets/nfts/nft-details/nft-full-image' ;
115
115
import CrossChainSwap from '../bridge' ;
116
116
import { ToastMaster } from '../../components/app/toast-master/toast-master' ;
117
+ import {
118
+ REDESIGN_APPROVAL_TYPES ,
119
+ REDESIGN_DEV_TRANSACTION_TYPES ,
120
+ } from '../confirmations/utils' ;
117
121
import {
118
122
getConnectingLabel ,
119
123
hideAppHeader ,
@@ -173,6 +177,9 @@ export default class Routes extends Component {
173
177
currentExtensionPopupId : PropTypes . number ,
174
178
useRequestQueue : PropTypes . bool ,
175
179
clearEditedNetwork : PropTypes . func . isRequired ,
180
+ oldestPendingApproval : PropTypes . object . isRequired ,
181
+ pendingApprovals : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
182
+ transactionsMetadata : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
176
183
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
177
184
isShowKeyringSnapRemovalResultModal : PropTypes . bool . isRequired ,
178
185
hideShowKeyringSnapRemovalResultModal : PropTypes . func . isRequired ,
@@ -417,6 +424,9 @@ export default class Routes extends Component {
417
424
switchedNetworkDetails,
418
425
clearSwitchedNetworkDetails,
419
426
clearEditedNetwork,
427
+ oldestPendingApproval,
428
+ pendingApprovals,
429
+ transactionsMetadata,
420
430
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
421
431
isShowKeyringSnapRemovalResultModal,
422
432
hideShowKeyringSnapRemovalResultModal,
@@ -452,7 +462,28 @@ export default class Routes extends Component {
452
462
isUnlocked &&
453
463
! shouldShowSeedPhraseReminder ;
454
464
455
- let isLoadingShown = isLoading && completedOnboarding ;
465
+ const paramsConfirmationId = location . pathname . split (
466
+ '/confirm-transaction/' ,
467
+ ) [ 1 ] ;
468
+ const confirmationId = paramsConfirmationId ?? oldestPendingApproval ?. id ;
469
+ const pendingApproval = pendingApprovals . find (
470
+ ( approval ) => approval . id === confirmationId ,
471
+ ) ;
472
+ const isCorrectApprovalType = REDESIGN_APPROVAL_TYPES . includes (
473
+ pendingApproval ?. type ,
474
+ ) ;
475
+ const isCorrectDeveloperTransactionType =
476
+ REDESIGN_DEV_TRANSACTION_TYPES . includes (
477
+ transactionsMetadata [ confirmationId ] ?. type ,
478
+ ) ;
479
+
480
+ let isLoadingShown =
481
+ isLoading &&
482
+ completedOnboarding &&
483
+ // In the redesigned screens, we hide the general loading spinner and the
484
+ // loading states are on a component by component basis.
485
+ ! isCorrectApprovalType &&
486
+ ! isCorrectDeveloperTransactionType ;
456
487
457
488
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
458
489
isLoadingShown =
@@ -462,7 +493,11 @@ export default class Routes extends Component {
462
493
( confirmation ) =>
463
494
confirmation . type ===
464
495
SNAP_MANAGE_ACCOUNTS_CONFIRMATION_TYPES . showSnapAccountRedirect ,
465
- ) ;
496
+ ) &&
497
+ // In the redesigned screens, we hide the general loading spinner and the
498
+ // loading states are on a component by component basis.
499
+ ! isCorrectApprovalType &&
500
+ ! isCorrectDeveloperTransactionType ;
466
501
///: END:ONLY_INCLUDE_IF
467
502
468
503
return (
0 commit comments