diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index 1d0fe1c8a3e6..24778b4988df 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -55,7 +55,7 @@ export default class AppStateController extends EventEmitter { // multiple networks. hadAdvancedGasFeesSetPriorToMigration92_3: false, ...initState, - qrHardwarePopoverState: {}, + qrHardware: {}, nftsDropdownState: {}, usedNetworks: { '0x1': true, @@ -379,12 +379,12 @@ export default class AppStateController extends EventEmitter { /** * Update the state of the QR hardware popover * - * @param qrHardwarePopoverState + * @param qrHardware * @returns {void} */ - updateQRHardwarePopoverState(qrHardwarePopoverState) { + updateQRHardware(qrHardware) { this.store.updateState({ - qrHardwarePopoverState, + qrHardware, }); } diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index e83af9643997..0d117f87e475 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -66,7 +66,7 @@ export const SENTRY_BACKGROUND_STATE = { notificationGasPollTokens: true, outdatedBrowserWarningLastShown: true, popupGasPollTokens: true, - qrHardwarePopoverState: true, + qrHardware: true, recoveryPhraseReminderHasBeenShown: true, recoveryPhraseReminderLastShown: true, serviceWorkerLastActiveTime: true, diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 31b59dc6288e..d0bbc4946fe4 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -3386,7 +3386,7 @@ export default class MetamaskController extends EventEmitter { keyring .getMemStore() .subscribe( - this.appStateController.updateQRHardwarePopoverState.bind( + this.appStateController.updateQRHardware.bind( this.appStateController, ), ); diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index ef0b01a81db6..42c4fea640a3 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -166,7 +166,7 @@ function defaultFixture() { fullScreenGasPollTokens: [], notificationGasPollTokens: [], popupGasPollTokens: [], - qrHardwarePopoverState: {}, + qrHardware: {}, recoveryPhraseReminderHasBeenShown: true, recoveryPhraseReminderLastShown: '__FIXTURE_SUBSTITUTION__currentDateInMilliseconds', @@ -331,7 +331,7 @@ function onboardingFixture() { fullScreenGasPollTokens: [], notificationGasPollTokens: [], popupGasPollTokens: [], - qrHardwarePopoverState: {}, + qrHardware: {}, recoveryPhraseReminderHasBeenShown: false, recoveryPhraseReminderLastShown: '__FIXTURE_SUBSTITUTION__currentDateInMilliseconds', diff --git a/test/e2e/tests/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/state-snapshots/errors-after-init-opt-in-background-state.json index 2e56be0e0b1f..6325ba3e6376 100644 --- a/test/e2e/tests/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/state-snapshots/errors-after-init-opt-in-background-state.json @@ -30,7 +30,7 @@ "trezorModel": null, "nftsDropdownState": {}, "termsOfUseLastAgreed": "number", - "qrHardwarePopoverState": {}, + "qrHardware": {}, "usedNetworks": { "0x1": true, "0x5": true, "0x539": true }, "snapsInstallPrivacyWarningShown": true, "hadAdvancedGasFeesSetPriorToMigration92_3": false, diff --git a/test/e2e/tests/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/state-snapshots/errors-after-init-opt-in-ui-state.json index 2ceea4cc4c72..31aa72b082ee 100644 --- a/test/e2e/tests/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -52,7 +52,7 @@ "trezorModel": null, "nftsDropdownState": {}, "termsOfUseLastAgreed": "number", - "qrHardwarePopoverState": {}, + "qrHardware": {}, "usedNetworks": { "0x1": true, "0x5": true, "0x539": true }, "snapsInstallPrivacyWarningShown": true, "hadAdvancedGasFeesSetPriorToMigration92_3": false, diff --git a/test/e2e/tests/state-snapshots/errors-before-init-opt-in-background-state.json b/test/e2e/tests/state-snapshots/errors-before-init-opt-in-background-state.json index 4dc0957b1000..75bd62d27908 100644 --- a/test/e2e/tests/state-snapshots/errors-before-init-opt-in-background-state.json +++ b/test/e2e/tests/state-snapshots/errors-before-init-opt-in-background-state.json @@ -15,7 +15,7 @@ "fullScreenGasPollTokens": [], "notificationGasPollTokens": [], "popupGasPollTokens": [], - "qrHardwarePopoverState": {}, + "qrHardware": {}, "recoveryPhraseReminderHasBeenShown": true, "recoveryPhraseReminderLastShown": "number", "showTestnetMessageInDropdown": true, diff --git a/test/e2e/tests/state-snapshots/errors-before-init-opt-in-ui-state.json b/test/e2e/tests/state-snapshots/errors-before-init-opt-in-ui-state.json index fe15eaf06e1e..5fa13c429985 100644 --- a/test/e2e/tests/state-snapshots/errors-before-init-opt-in-ui-state.json +++ b/test/e2e/tests/state-snapshots/errors-before-init-opt-in-ui-state.json @@ -15,7 +15,7 @@ "fullScreenGasPollTokens": [], "notificationGasPollTokens": [], "popupGasPollTokens": [], - "qrHardwarePopoverState": {}, + "qrHardware": {}, "recoveryPhraseReminderHasBeenShown": true, "recoveryPhraseReminderLastShown": "number", "showTestnetMessageInDropdown": true, diff --git a/ui/components/app/qr-hardware-popover/qr-hardware-popover.js b/ui/components/app/qr-hardware-popover/qr-hardware-popover.js index c610b9c4de01..a81a4edef4a2 100644 --- a/ui/components/app/qr-hardware-popover/qr-hardware-popover.js +++ b/ui/components/app/qr-hardware-popover/qr-hardware-popover.js @@ -1,7 +1,7 @@ import React, { useCallback, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { ethErrors, serializeError } from 'eth-rpc-errors'; -import { getCurrentQRHardwarePopoverState } from '../../../selectors'; +import { getCurrentQRHardwareState } from '../../../selectors'; import Popover from '../../ui/popover'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { @@ -16,7 +16,7 @@ import QRHardwareSignRequest from './qr-hardware-sign-request'; const QRHardwarePopover = () => { const t = useI18nContext(); - const { sync, sign } = useSelector(getCurrentQRHardwarePopoverState); + const { sync, sign } = useSelector(getCurrentQRHardwareState); const showWalletImporter = sync?.reading; const showSignRequest = sign?.request; const showPopover = showWalletImporter || showSignRequest; diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 3f00e1ca211d..2d76d4838bfa 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -148,9 +148,9 @@ export function isCurrentProviderCustom(state) { ); } -export function getCurrentQRHardwarePopoverState(state) { - const { qrHardwarePopoverState } = state.metamask; - return qrHardwarePopoverState || {}; +export function getCurrentQRHardwareState(state) { + const { qrHardware } = state.metamask; + return qrHardware || {}; } export function hasUnsignedQRHardwareTransaction(state) {