Skip to content

Commit

Permalink
feat: rename oneKeyViaTrezor occurences to oneKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Akaryatrh committed Jan 13, 2025
1 parent 31e7a91 commit 70c0d6f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4890,7 +4890,7 @@ export default class MetamaskController extends EventEmitter {
let keyringName = null;
switch (deviceName) {
case HardwareDeviceNames.trezor:
case HardwareDeviceNames.oneKeyViaTrezor:
case HardwareDeviceNames.oneKey:
keyringName = keyringOverrides?.trezor?.type || TrezorKeyring.type;
break;
case HardwareDeviceNames.ledger:
Expand Down Expand Up @@ -4999,7 +4999,7 @@ export default class MetamaskController extends EventEmitter {
const { minorVersion } = keyring.bridge;
// Specific case for OneKey devices, see `ONE_KEY_VIA_TREZOR_MINOR_VERSION` for further details.
if (minorVersion && minorVersion === ONE_KEY_VIA_TREZOR_MINOR_VERSION) {
return HardwareDeviceNames.oneKeyViaTrezor;
return HardwareDeviceNames.oneKey;
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ describe('MetaMaskController', () => {
deviceName,
hdPath,
);
expect(result).toBe('OneKey via Trezor');
expect(result).toBe('OneKey');
});
});

Expand Down
2 changes: 1 addition & 1 deletion shared/constants/hardware-wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export enum HardwareKeyringNames {
export enum HardwareDeviceNames {
ledger = 'ledger',
trezor = 'trezor',
oneKeyViaTrezor = 'OneKey via Trezor',
oneKey = 'OneKey',
lattice = 'lattice',
qr = 'QR Hardware',
}
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/create-account/connect-hardware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ConnectHardwareForm extends Component {
async checkIfUnlocked() {
for (const device of [
HardwareDeviceNames.trezor,
HardwareDeviceNames.oneKeyViaTrezor,
HardwareDeviceNames.oneKey,
HardwareDeviceNames.ledger,
HardwareDeviceNames.lattice,
]) {
Expand Down
9 changes: 4 additions & 5 deletions ui/pages/create-account/connect-hardware/select-hardware.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class SelectHardware extends Component {
if (this.state.selectedDevice) {
if (
(this.state.selectedDevice === HardwareDeviceNames.trezor ||
this.state.selectedDevice === HardwareDeviceNames.oneKeyViaTrezor) &&
this.state.selectedDevice === HardwareDeviceNames.oneKey) &&
isUSBSupported
) {
this.setState({
Expand Down Expand Up @@ -119,11 +119,10 @@ export default class SelectHardware extends Component {
<button
data-testid="connect-onekey-btn"
className={classnames('hw-connect__btn', {
selected:
this.state.selectedDevice === HardwareDeviceNames.oneKeyViaTrezor,
selected: this.state.selectedDevice === HardwareDeviceNames.oneKey,
})}
onClick={(_) =>
this.setState({ selectedDevice: HardwareDeviceNames.oneKeyViaTrezor })
this.setState({ selectedDevice: HardwareDeviceNames.oneKey })
}
>
<LogoOnekey className="hw-connect__btn__img" ariaLabel="OneKey" />
Expand Down Expand Up @@ -332,7 +331,7 @@ export default class SelectHardware extends Component {
return this.renderLedgerTutorialSteps();
case HardwareDeviceNames.trezor:
return this.renderTrezorTutorialSteps();
case HardwareDeviceNames.oneKeyViaTrezor:
case HardwareDeviceNames.oneKey:
return this.renderOnekeyTutorialSteps();
case HardwareDeviceNames.lattice:
return this.renderLatticeTutorialSteps();
Expand Down

0 comments on commit 70c0d6f

Please sign in to comment.