@@ -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 ,
@@ -174,6 +178,9 @@ export default class Routes extends Component {
174
178
currentExtensionPopupId : PropTypes . number ,
175
179
useRequestQueue : PropTypes . bool ,
176
180
clearEditedNetwork : PropTypes . func . isRequired ,
181
+ oldestPendingApproval : PropTypes . object . isRequired ,
182
+ pendingApprovals : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
183
+ transactionsMetadata : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
177
184
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
178
185
isShowKeyringSnapRemovalResultModal : PropTypes . bool . isRequired ,
179
186
hideShowKeyringSnapRemovalResultModal : PropTypes . func . isRequired ,
@@ -419,6 +426,9 @@ export default class Routes extends Component {
419
426
clearSwitchedNetworkDetails,
420
427
clearEditedNetwork,
421
428
privacyMode,
429
+ oldestPendingApproval,
430
+ pendingApprovals,
431
+ transactionsMetadata,
422
432
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
423
433
isShowKeyringSnapRemovalResultModal,
424
434
hideShowKeyringSnapRemovalResultModal,
@@ -454,7 +464,28 @@ export default class Routes extends Component {
454
464
isUnlocked &&
455
465
! shouldShowSeedPhraseReminder ;
456
466
457
- let isLoadingShown = isLoading && completedOnboarding ;
467
+ const paramsConfirmationId = location . pathname . split (
468
+ '/confirm-transaction/' ,
469
+ ) [ 1 ] ;
470
+ const confirmationId = paramsConfirmationId ?? oldestPendingApproval ?. id ;
471
+ const pendingApproval = pendingApprovals . find (
472
+ ( approval ) => approval . id === confirmationId ,
473
+ ) ;
474
+ const isCorrectApprovalType = REDESIGN_APPROVAL_TYPES . includes (
475
+ pendingApproval ?. type ,
476
+ ) ;
477
+ const isCorrectDeveloperTransactionType =
478
+ REDESIGN_DEV_TRANSACTION_TYPES . includes (
479
+ transactionsMetadata [ confirmationId ] ?. type ,
480
+ ) ;
481
+
482
+ let isLoadingShown =
483
+ isLoading &&
484
+ completedOnboarding &&
485
+ // In the redesigned screens, we hide the general loading spinner and the
486
+ // loading states are on a component by component basis.
487
+ ! isCorrectApprovalType &&
488
+ ! isCorrectDeveloperTransactionType ;
458
489
459
490
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
460
491
isLoadingShown =
@@ -464,7 +495,11 @@ export default class Routes extends Component {
464
495
( confirmation ) =>
465
496
confirmation . type ===
466
497
SNAP_MANAGE_ACCOUNTS_CONFIRMATION_TYPES . showSnapAccountRedirect ,
467
- ) ;
498
+ ) &&
499
+ // In the redesigned screens, we hide the general loading spinner and the
500
+ // loading states are on a component by component basis.
501
+ ! isCorrectApprovalType &&
502
+ ! isCorrectDeveloperTransactionType ;
468
503
///: END:ONLY_INCLUDE_IF
469
504
470
505
return (
0 commit comments