refactor(suite-common): firmware package without wallet-core dependency

This commit is contained in:
Szymon Lesisz
2026-02-10 12:35:06 +01:00
parent 7f8e04f95e
commit d70cd267d4
5 changed files with 2 additions and 8 deletions

View File

@@ -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:*",

View File

@@ -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());

View File

@@ -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.

View File

@@ -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" },

View File

@@ -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:*"