Skip to content

Commit

Permalink
fix: rollback qrHardware var name change
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesposito committed Sep 26, 2023
1 parent b4b5872 commit b7bbcec
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions app/scripts/controllers/app-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class AppStateController extends EventEmitter {
// multiple networks.
hadAdvancedGasFeesSetPriorToMigration92_3: false,
...initState,
qrHardwarePopoverState: {},
qrHardware: {},
nftsDropdownState: {},
usedNetworks: {
'0x1': true,
Expand Down Expand Up @@ -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,
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/lib/setupSentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3386,7 +3386,7 @@ export default class MetamaskController extends EventEmitter {
keyring
.getMemStore()
.subscribe(
this.appStateController.updateQRHardwarePopoverState.bind(
this.appStateController.updateQRHardware.bind(
this.appStateController,
),
);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function defaultFixture() {
fullScreenGasPollTokens: [],
notificationGasPollTokens: [],
popupGasPollTokens: [],
qrHardwarePopoverState: {},
qrHardware: {},
recoveryPhraseReminderHasBeenShown: true,
recoveryPhraseReminderLastShown:
'__FIXTURE_SUBSTITUTION__currentDateInMilliseconds',
Expand Down Expand Up @@ -331,7 +331,7 @@ function onboardingFixture() {
fullScreenGasPollTokens: [],
notificationGasPollTokens: [],
popupGasPollTokens: [],
qrHardwarePopoverState: {},
qrHardware: {},
recoveryPhraseReminderHasBeenShown: false,
recoveryPhraseReminderLastShown:
'__FIXTURE_SUBSTITUTION__currentDateInMilliseconds',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"trezorModel": null,
"nftsDropdownState": {},
"termsOfUseLastAgreed": "number",
"qrHardwarePopoverState": {},
"qrHardware": {},
"usedNetworks": { "0x1": true, "0x5": true, "0x539": true },
"snapsInstallPrivacyWarningShown": true,
"hadAdvancedGasFeesSetPriorToMigration92_3": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"trezorModel": null,
"nftsDropdownState": {},
"termsOfUseLastAgreed": "number",
"qrHardwarePopoverState": {},
"qrHardware": {},
"usedNetworks": { "0x1": true, "0x5": true, "0x539": true },
"snapsInstallPrivacyWarningShown": true,
"hadAdvancedGasFeesSetPriorToMigration92_3": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"fullScreenGasPollTokens": [],
"notificationGasPollTokens": [],
"popupGasPollTokens": [],
"qrHardwarePopoverState": {},
"qrHardware": {},
"recoveryPhraseReminderHasBeenShown": true,
"recoveryPhraseReminderLastShown": "number",
"showTestnetMessageInDropdown": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"fullScreenGasPollTokens": [],
"notificationGasPollTokens": [],
"popupGasPollTokens": [],
"qrHardwarePopoverState": {},
"qrHardware": {},
"recoveryPhraseReminderHasBeenShown": true,
"recoveryPhraseReminderLastShown": "number",
"showTestnetMessageInDropdown": true,
Expand Down
4 changes: 2 additions & 2 deletions ui/components/app/qr-hardware-popover/qr-hardware-popover.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b7bbcec

Please sign in to comment.