mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-02-20 00:33:07 +01:00
refactor(suite-common): firmware package without wallet-core dependency
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
"@suite-common/redux-utils": "workspace:*",
|
||||
"@suite-common/suite-types": "workspace:*",
|
||||
"@suite-common/thp": "workspace:*",
|
||||
"@suite-common/wallet-core": "workspace:*",
|
||||
"@trezor/connect": "workspace:*",
|
||||
"@trezor/device-utils": "workspace:*",
|
||||
"@trezor/env-utils": "workspace:*",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { createThunk } from '@suite-common/redux-utils';
|
||||
import { TrezorDevice } from '@suite-common/suite-types';
|
||||
import { selectSelectedDevice } from '@suite-common/wallet-core';
|
||||
import TrezorConnect, { FirmwareType } from '@trezor/connect';
|
||||
import { hasBitcoinOnlyFirmware, isBitcoinOnlyDevice } from '@trezor/device-utils';
|
||||
|
||||
@@ -47,7 +46,7 @@ export const firmwareUpdate = createThunk<
|
||||
services: { reportSecurityCheck },
|
||||
} = extra;
|
||||
|
||||
const device = selectSelectedDevice(getState());
|
||||
const device = extra.selectors.selectDevice(getState());
|
||||
const binFilesBaseUrl = await dispatch(getBinFilesBaseUrlThunk()).unwrap();
|
||||
const suiteLanguage = selectLanguage(getState());
|
||||
const { useDevkit, cachedDevice, error } = selectFirmware(getState());
|
||||
|
||||
@@ -3,7 +3,6 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
import { ButtonRequest, FirmwareStatus, TrezorDevice } from '@suite-common/suite-types';
|
||||
import { THP_BUTTON_REQUESTS_NAMES, selectIsThpInProgress, selectThpStep } from '@suite-common/thp';
|
||||
import { selectSelectedDevice } from '@suite-common/wallet-core';
|
||||
import { DEVICE, type Device, DeviceButtonRequestPayload, FirmwareType, UI } from '@trezor/connect';
|
||||
import {
|
||||
DeviceModelInternal,
|
||||
@@ -104,7 +103,6 @@ const shouldShowReconnectPrompt = ({
|
||||
export const useFirmwareInstallation = () => {
|
||||
const dispatch = useDispatch();
|
||||
const firmware = useSelector(selectFirmware);
|
||||
const device = useSelector(selectSelectedDevice);
|
||||
const isThpInProgress = useSelector(selectIsThpInProgress);
|
||||
const thpStep = useSelector(selectThpStep);
|
||||
const switchFirmwareType = useSelector(selectSwitchFirmwareType);
|
||||
@@ -127,7 +125,7 @@ export const useFirmwareInstallation = () => {
|
||||
|
||||
// Device in its state before installation is cached when installation begins.
|
||||
// Until then, access device as normal.
|
||||
const originalDevice = firmware.cachedDevice || device;
|
||||
const originalDevice = firmware.cachedDevice;
|
||||
|
||||
// To instruct user to reboot to bootloader manually, UI.FIRMWARE_DISCONNECT event is emitted first,
|
||||
// and UI.FIRMWARE_RECONNECT is emitted after the device disconnects.
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
{ "path": "../redux-utils" },
|
||||
{ "path": "../suite-types" },
|
||||
{ "path": "../thp" },
|
||||
{ "path": "../wallet-core" },
|
||||
{ "path": "../../packages/connect" },
|
||||
{ "path": "../../packages/device-utils" },
|
||||
{ "path": "../../packages/env-utils" },
|
||||
|
||||
@@ -11044,7 +11044,6 @@ __metadata:
|
||||
"@suite-common/redux-utils": "workspace:*"
|
||||
"@suite-common/suite-types": "workspace:*"
|
||||
"@suite-common/thp": "workspace:*"
|
||||
"@suite-common/wallet-core": "workspace:*"
|
||||
"@trezor/connect": "workspace:*"
|
||||
"@trezor/device-utils": "workspace:*"
|
||||
"@trezor/env-utils": "workspace:*"
|
||||
|
||||
Reference in New Issue
Block a user