diff --git a/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts b/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts index af29a78966..7a50317095 100644 --- a/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts +++ b/packages/suite/src/actions/wallet/__tests__/blockchainActions.test.ts @@ -1,5 +1,9 @@ +import { TranslationKey } from '@suite/intl'; import { testMocks } from '@suite-common/test-utils'; -import { notificationsActions, notificationsReducer } from '@suite-common/toast-notifications'; +import { + createNotificationsReducer, + notificationsActions, +} from '@suite-common/toast-notifications'; import { AccountsState, BlockchainState, @@ -24,6 +28,8 @@ import * as fixtures from '../__fixtures__/blockchainActions'; const TrezorConnect = testMocks.getTrezorConnectMock(); +const { reducer: notificationsReducer } = createNotificationsReducer(); + interface Args { accounts?: AccountsState; blockchain?: Partial; diff --git a/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx b/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx index 12c93d44b1..603d9c00ce 100644 --- a/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx +++ b/packages/suite/src/components/suite/notifications/NotificationRenderer/NotificationRenderer.tsx @@ -1,7 +1,7 @@ import { ComponentType, JSX } from 'react'; import { useSelector } from 'react-redux'; -import { ExtendedMessageDescriptor, Translation } from '@suite/intl'; +import { ExtendedMessageDescriptor, Translation, TranslationKey } from '@suite/intl'; import { selectSelectedDeviceLabelOrName } from '@suite-common/device'; import { AUTH_DEVICE, type NotificationEntry } from '@suite-common/toast-notifications'; import { getNetworkDisplaySymbol } from '@suite-common/wallet-config'; @@ -15,11 +15,13 @@ import { ExchangeInfoRenderer } from './ExchangeInfoRenderer'; import { TransactionRenderer } from './TransactionRenderer'; import { NotificationViewProps } from '../Notifications/NotificationGroup/NotificationList/NotificationView'; +type LocalizedNotificationEntry = NotificationEntry; + export type NotificationRendererProps< - T extends NotificationEntry['type'] = NotificationEntry['type'], + T extends LocalizedNotificationEntry['type'] = LocalizedNotificationEntry['type'], > = { render: ComponentType<{ onCancel?: () => void } & NotificationViewProps>; - notification: Extract; + notification: Extract; }; type RenderConfig = { diff --git a/packages/suite/src/components/suite/notifications/Toaster/renderToast.tsx b/packages/suite/src/components/suite/notifications/Toaster/renderToast.tsx index 8e51dffac6..93a3169ecb 100644 --- a/packages/suite/src/components/suite/notifications/Toaster/renderToast.tsx +++ b/packages/suite/src/components/suite/notifications/Toaster/renderToast.tsx @@ -1,8 +1,9 @@ +import { TranslationKey } from '@suite/intl'; import { NotificationEntry } from '@suite-common/toast-notifications'; import { ToastNotificationView } from './ToastNotificationView'; import { NotificationRenderer } from '../NotificationRenderer/NotificationRenderer'; -export const renderToast = (payload: NotificationEntry) => ( +export const renderToast = (payload: NotificationEntry) => ( ); diff --git a/packages/suite/src/components/suite/notifications/Toaster/toastEngine.ts b/packages/suite/src/components/suite/notifications/Toaster/toastEngine.ts index fd33775c94..3361f30010 100644 --- a/packages/suite/src/components/suite/notifications/Toaster/toastEngine.ts +++ b/packages/suite/src/components/suite/notifications/Toaster/toastEngine.ts @@ -1,10 +1,13 @@ import { toast } from 'react-toastify/unstyled'; +import { TranslationKey } from '@suite/intl'; import type { NotificationEntry } from '@suite-common/toast-notifications'; import { renderToast } from './renderToast'; -const sanitize = (payload: NotificationEntry): NotificationEntry => { +const sanitize = ( + payload: NotificationEntry, +): NotificationEntry => { const next = { ...payload }; if (typeof next.error === 'string' && next.error.includes('assetType:')) { @@ -14,7 +17,7 @@ const sanitize = (payload: NotificationEntry): NotificationEntry => { return next; }; -export const showToast = (payload: NotificationEntry) => { +export const showToast = (payload: NotificationEntry) => { const entry = sanitize(payload); toast(renderToast(entry), { diff --git a/packages/suite/src/hooks/wallet/form/useCompose.ts b/packages/suite/src/hooks/wallet/form/useCompose.ts index 1092d5113c..3cc637a25a 100644 --- a/packages/suite/src/hooks/wallet/form/useCompose.ts +++ b/packages/suite/src/hooks/wallet/form/useCompose.ts @@ -3,7 +3,7 @@ import { FieldPath, UseFormReturn } from 'react-hook-form'; import { isFulfilled } from '@reduxjs/toolkit'; -import { useTranslation } from '@suite/intl'; +import { isTranslationKey, useTranslation } from '@suite/intl'; import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; import { composeSendFormTransactionFeeLevelsThunk } from '@suite-common/wallet-core'; import { @@ -123,7 +123,7 @@ export const useCompose = ({ const values = getValues(); if (composed.type === 'error') { const { error, errorMessage } = composed; - if (!errorMessage) { + if (!errorMessage || !isTranslationKey(errorMessage.id)) { // composed tx doesn't have an errorMessage (Translation props) // this error is unexpected and should be handled in sendFormActions console.warn('Compose unexpected error', error); @@ -176,8 +176,12 @@ export const useCompose = ({ ...composedLevels, custom: prevLevel, } as - | (PrecomposedLevels & { custom: PrecomposedTransaction }) - | (PrecomposedLevelsCardano & { custom: PrecomposedTransactionCardano }); + | (PrecomposedLevels & { + custom: PrecomposedTransaction; + }) + | (PrecomposedLevelsCardano & { + custom: PrecomposedTransactionCardano; + }); setComposedLevels(levels); } else { const currentLevel = composedLevels[current || 'normal']; diff --git a/packages/suite/src/hooks/wallet/form/useStakeCompose.ts b/packages/suite/src/hooks/wallet/form/useStakeCompose.ts index ef4203025a..b65331fce6 100644 --- a/packages/suite/src/hooks/wallet/form/useStakeCompose.ts +++ b/packages/suite/src/hooks/wallet/form/useStakeCompose.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'; import { FieldPath, UseFormReturn } from 'react-hook-form'; -import { useTranslation } from '@suite/intl'; +import { isTranslationKey, useTranslation } from '@suite/intl'; import { COMPOSE_ERROR_TYPES } from '@suite-common/wallet-constants'; import { ComposeActionContext, @@ -107,7 +107,7 @@ export const useStakeCompose = ({ if (composed.type === 'error') { const { error, errorMessage } = composed; - if (!errorMessage) { + if (!errorMessage || !isTranslationKey(errorMessage.id)) { // composed tx doesn't have an errorMessage (Translation props) // this error is unexpected and should be handled in sendFormActions console.warn('Compose unexpected error', error); @@ -159,7 +159,9 @@ export const useStakeCompose = ({ const levels = { ...composedLevels, custom: prevLevel, - } as PrecomposedLevels & { custom: PrecomposedTransaction }; + } as PrecomposedLevels & { + custom: PrecomposedTransaction; + }; setComposedLevels(levels); } else { const currentLevel = composedLevels[current || 'normal']; diff --git a/packages/suite/src/hooks/wallet/trading/form/common/useTradingComposeTransaction.ts b/packages/suite/src/hooks/wallet/trading/form/common/useTradingComposeTransaction.ts index d957a6fc34..d2bee0a0e3 100644 --- a/packages/suite/src/hooks/wallet/trading/form/common/useTradingComposeTransaction.ts +++ b/packages/suite/src/hooks/wallet/trading/form/common/useTradingComposeTransaction.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo, useState } from 'react'; import { UseFormReturn } from 'react-hook-form'; -import { useTranslation } from '@suite/intl'; +import { isTranslationKey, useTranslation } from '@suite/intl'; import { selectSelectedDevice } from '@suite-common/device'; import { TRADING_FORM_OUTPUT_ADDRESS, @@ -142,7 +142,7 @@ export const useTradingComposeTransaction = (); type ProtocolState = ReturnType; type NotificationsState = ReturnType; @@ -38,7 +40,7 @@ const initStore = (state: State) => { store.getState().protocol = protocolReducer(protocol, action); store.getState().notifications = notificationsReducer( - notifications as NotificationEntry[], + notifications as NotificationEntry[], action, ); diff --git a/packages/suite/src/middlewares/suite/toastMiddleware.ts b/packages/suite/src/middlewares/suite/toastMiddleware.ts index 66282b71ff..9df2301428 100644 --- a/packages/suite/src/middlewares/suite/toastMiddleware.ts +++ b/packages/suite/src/middlewares/suite/toastMiddleware.ts @@ -1,5 +1,6 @@ +import { TranslationKey } from '@suite/intl'; import { createMiddleware } from '@suite-common/redux-utils'; -import { notificationsActions } from '@suite-common/toast-notifications'; +import { NotificationEntry, notificationsActions } from '@suite-common/toast-notifications'; import { dismissToast, showToast } from 'src/components/suite'; @@ -9,7 +10,7 @@ export const toastMiddleware = createMiddleware((action, { next }) => { } if (notificationsActions.addToast.match(action)) { - showToast(action.payload); + showToast(action.payload as NotificationEntry); } return next(action); diff --git a/packages/suite/src/reducers/suite/index.ts b/packages/suite/src/reducers/suite/index.ts index 9df10a65e7..9e893ebf30 100644 --- a/packages/suite/src/reducers/suite/index.ts +++ b/packages/suite/src/reducers/suite/index.ts @@ -1,10 +1,11 @@ import { experimentalFeedbackReducer } from '@suite/experimental-feedback'; +import { TranslationKey } from '@suite/intl'; import { metadataReducer } from '@suite/metadata'; import { prepareAnalyticsReducer } from '@suite-common/analytics-redux'; import { prepareConnectPopupReducer } from '@suite-common/connect-popup'; import { logsSlice } from '@suite-common/logger'; import { prepareMessageSystemReducer } from '@suite-common/message-system'; -import { notificationsReducer } from '@suite-common/toast-notifications'; +import { createNotificationsReducer } from '@suite-common/toast-notifications'; import { prepareWalletConnectReducer } from '@suite-common/walletconnect'; import { deviceSlice } from 'src/actions/device/deviceSlice'; @@ -31,7 +32,7 @@ export default { modal, device, logs: logsSlice.reducer, - notifications: notificationsReducer, + notifications: createNotificationsReducer().reducer, window, analytics, metadata: metadataReducer, diff --git a/packages/suite/src/types/wallet/__tests__/transaction.test.ts b/packages/suite/src/types/wallet/__tests__/transaction.test.ts new file mode 100644 index 0000000000..e043e80091 --- /dev/null +++ b/packages/suite/src/types/wallet/__tests__/transaction.test.ts @@ -0,0 +1,9 @@ +import { isTranslationKey } from '@suite/intl'; +import { SUITE_PRECOMPOSE_ERRORS } from '@suite-common/wallet-types'; + +it.each(Object.values(SUITE_PRECOMPOSE_ERRORS))( + 'precomposed error %s should be translatable', + error => { + expect(isTranslationKey(error)).toBe(true); + }, +); diff --git a/packages/suite/src/utils/suite/notification.ts b/packages/suite/src/utils/suite/notification.ts index 9186f757fa..792c409217 100644 --- a/packages/suite/src/utils/suite/notification.ts +++ b/packages/suite/src/utils/suite/notification.ts @@ -1,3 +1,4 @@ +import { TranslationKey } from '@suite/intl'; import { NotificationEntry } from '@suite-common/toast-notifications'; import { intermediaryTheme } from '@trezor/components'; @@ -39,8 +40,8 @@ export const filterNonActivityNotifications = (notifications: AppState['notifica notifications.filter(notification => notification.type !== 'coin-scheme-protocol'); export const getSeenAndUnseenNotifications = (notifications: AppState['notifications']) => { - const seen: Array = []; - const unseen: Array = []; + const seen: Array> = []; + const unseen: Array> = []; // loop over all notifications and check which of them there were seen or not filterNonActivityNotifications(notifications).forEach(notification => { diff --git a/suite-common/toast-notifications/src/notificationsReducer.ts b/suite-common/toast-notifications/src/notificationsReducer.ts index f9bd498c1c..8957e855b1 100644 --- a/suite-common/toast-notifications/src/notificationsReducer.ts +++ b/suite-common/toast-notifications/src/notificationsReducer.ts @@ -1,39 +1,48 @@ -import { createReducer, isAnyOf } from '@reduxjs/toolkit'; +import { WritableDraft, createReducer, isAnyOf } from '@reduxjs/toolkit'; import { notificationsActions } from './notificationsActions'; -import { NotificationsState } from './types'; +import { NotificationEntry, NotificationsState, UnknownTranslationKey } from './types'; -export const notificationsInitialState: NotificationsState = []; +export function createNotificationsReducer< + TranslationKey extends UnknownTranslationKey = UnknownTranslationKey, +>() { + const notificationsInitialState: NotificationsState = []; -export const notificationsReducer = createReducer(notificationsInitialState, builder => { - builder - .addCase(notificationsActions.close, (state, { payload }) => { - const item = state.find(n => n.id === payload); - if (item) item.closed = true; - }) - .addCase(notificationsActions.resetUnseen, (state, { payload }) => { - if (!payload) { - state.forEach(n => { - if (!n.seen) n.seen = true; + const notificationsReducer = createReducer(notificationsInitialState, builder => { + builder + .addCase(notificationsActions.close, (state, { payload }) => { + const item = state.find(n => n.id === payload); + if (item) item.closed = true; + }) + .addCase(notificationsActions.resetUnseen, (state, { payload }) => { + if (!payload) { + state.forEach(n => { + if (!n.seen) n.seen = true; + }); + } else { + payload.forEach(p => { + const item = state.find(n => n.id === p.id); + if (item) item.seen = true; + }); + } + }) + .addCase(notificationsActions.remove, (state, { payload }) => { + const arr = !Array.isArray(payload) ? [payload] : payload; + arr.forEach(item => { + const index = state.findIndex(n => n.id === item.id); + state.splice(index, 1); }); - } else { - payload.forEach(p => { - const item = state.find(n => n.id === p.id); - if (item) item.seen = true; - }); - } - }) - .addCase(notificationsActions.remove, (state, { payload }) => { - const arr = !Array.isArray(payload) ? [payload] : payload; - arr.forEach(item => { - const index = state.findIndex(n => n.id === item.id); - state.splice(index, 1); - }); - }) - .addMatcher( - isAnyOf(notificationsActions.addEvent, notificationsActions.addToast), - (state, { payload }) => { - state.unshift(payload); - }, - ); -}); + }) + .addMatcher( + isAnyOf(notificationsActions.addEvent, notificationsActions.addToast), + (state, { payload }) => { + state.unshift(payload as WritableDraft>); + }, + ); + }); + + return { + reducer: notificationsReducer, + initialState: notificationsInitialState, + }; +} diff --git a/suite-common/toast-notifications/src/tests/notificationsReducer.test.ts b/suite-common/toast-notifications/src/tests/notificationsReducer.test.ts index 8ba6e75510..139b20c189 100644 --- a/suite-common/toast-notifications/src/tests/notificationsReducer.test.ts +++ b/suite-common/toast-notifications/src/tests/notificationsReducer.test.ts @@ -1,11 +1,13 @@ import { configureMockStore } from '@suite-common/test-utils'; import { notificationsActions } from '../notificationsActions'; -import { notificationsReducer } from '../notificationsReducer'; +import { createNotificationsReducer } from '../notificationsReducer'; import { selectNotifications } from '../notificationsSelectors'; import { removeAccountEventsThunk, removeTransactionEventsThunk } from '../notificationsThunks'; import { NotificationsRootState, NotificationsState } from '../types'; +const { reducer: notificationsReducer } = createNotificationsReducer(); + interface InitStoreArgs { preloadedState?: NotificationsRootState; } diff --git a/suite-common/wallet-types/package.json b/suite-common/wallet-types/package.json index bb5fad08f6..82a2a0141f 100644 --- a/suite-common/wallet-types/package.json +++ b/suite-common/wallet-types/package.json @@ -13,7 +13,6 @@ "@suite-common/metadata-types": "workspace:*", "@suite-common/wallet-config": "workspace:*", "@suite-common/wallet-constants": "workspace:*", - "@suite/intl": "workspace:*", "@trezor/blockchain-link-types": "workspace:*", "@trezor/connect": "workspace:*", "@trezor/type-utils": "workspace:*", diff --git a/suite-common/wallet-types/src/transaction.ts b/suite-common/wallet-types/src/transaction.ts index bb86d130e7..5a2e2f833a 100644 --- a/suite-common/wallet-types/src/transaction.ts +++ b/suite-common/wallet-types/src/transaction.ts @@ -1,5 +1,3 @@ -// eslint-disable-next-line local-rules/no-suite-imports-in-suite-common -import { TranslationKey } from '@suite/intl'; import { Network, NetworkSymbol } from '@suite-common/wallet-config'; import { BaseCurrencyCode } from '@trezor/blockchain-link-types'; import { @@ -18,25 +16,52 @@ import { StaticSessionId, TokenInfo, } from '@trezor/connect'; -import { Branded, RequiredKey } from '@trezor/type-utils'; +import { Branded, ObjectValues, RequiredKey } from '@trezor/type-utils'; import { Account, AccountDescriptor } from './account'; export type { PrecomposedTransactionFinalCardano } from '@trezor/connect'; +export const COMMON_PRECOMPOSE_ERRORS = { + AMOUNT_NOT_ENOUGH_CURRENCY_FEE: 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE', + AMOUNT_IS_NOT_ENOUGH: 'AMOUNT_IS_NOT_ENOUGH', + AMOUNT_IS_TOO_LOW: 'AMOUNT_IS_TOO_LOW', + AMOUNT_IS_LESS_THAN_RESERVE: 'AMOUNT_IS_LESS_THAN_RESERVE', + REMAINING_BALANCE_LESS_THAN_RENT: 'REMAINING_BALANCE_LESS_THAN_RENT', + AMOUNT_NOT_ENOUGH_CURRENCY_FEE_WITH_ETH_AMOUNT: + 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE_WITH_ETH_AMOUNT', +} as const satisfies Record; + +/** + * @trezor/suite (packages/suite) errors + */ +export const SUITE_PRECOMPOSE_ERRORS = { + ...COMMON_PRECOMPOSE_ERRORS, + TR_NOT_ENOUGH_SELECTED: 'TR_NOT_ENOUGH_SELECTED', + TR_NOT_ENOUGH_ANONYMIZED_FUNDS_WARNING: 'TR_NOT_ENOUGH_ANONYMIZED_FUNDS_WARNING', + TR_GENERIC_ERROR_TITLE: 'TR_GENERIC_ERROR_TITLE', +} as const satisfies Record; + +export type SuitePrecomposeError = ObjectValues; + +/** + * @suite-native/* errors + */ +export const SUITE_NATIVE_PRECOMPOSE_ERRORS = { + ...COMMON_PRECOMPOSE_ERRORS, + TR_STAKE_NOT_ENOUGH_FUNDS: 'TR_STAKE_NOT_ENOUGH_FUNDS', +} as const satisfies Record; + +export type SuiteNativePrecomposeError = ObjectValues; + +export type PrecomposeError = SuiteNativePrecomposeError | SuitePrecomposeError; + // extend errors from @trezor/connect + @trezor/utxo-lib with errors from sendForm actions type PrecomposedTransactionErrorExtended = | PrecomposedTransactionConnectResponseError | { type: 'error'; - error: - | 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE' - | 'AMOUNT_IS_NOT_ENOUGH' - | 'AMOUNT_IS_TOO_LOW' - | 'AMOUNT_IS_LESS_THAN_RESERVE' - | 'TR_STAKE_NOT_ENOUGH_FUNDS' - | 'REMAINING_BALANCE_LESS_THAN_RENT' - | 'AMOUNT_NOT_ENOUGH_CURRENCY_FEE_WITH_ETH_AMOUNT'; + error: PrecomposeError; }; export type PrecomposedTransactionCardanoNonFinal = @@ -105,7 +130,7 @@ export type ExternalOutput = Exclude; }; }; @@ -187,7 +212,9 @@ export type GeneralPrecomposedTransactionFinal = Extract< >; export type PrecomposedLevels = Record; + export type PrecomposedLevelsCardano = Record; + export type GeneralPrecomposedLevels = PrecomposedLevels | PrecomposedLevelsCardano; export interface RbfTransactionParamsBitcoin { diff --git a/suite-common/wallet-types/tsconfig.json b/suite-common/wallet-types/tsconfig.json index 2013309c7f..7c18bd99ca 100644 --- a/suite-common/wallet-types/tsconfig.json +++ b/suite-common/wallet-types/tsconfig.json @@ -5,7 +5,6 @@ { "path": "../metadata-types" }, { "path": "../wallet-config" }, { "path": "../wallet-constants" }, - { "path": "../../suite/intl" }, { "path": "../../packages/blockchain-link-types" }, diff --git a/suite-native/module-trading/src/hooks/exchange/useExchangeFlow.tsx b/suite-native/module-trading/src/hooks/exchange/useExchangeFlow.tsx index ed28cf807c..3f08748a61 100644 --- a/suite-native/module-trading/src/hooks/exchange/useExchangeFlow.tsx +++ b/suite-native/module-trading/src/hooks/exchange/useExchangeFlow.tsx @@ -10,7 +10,6 @@ import { selectTradingExchangeSelectedQuote, } from '@suite-common/trading'; import { events } from '@suite-native/analytics'; -import { TxKeyPath } from '@suite-native/intl'; import { useAnalytics } from '@suite-native/services'; import { buildTradingUrl, useBrowserAuth } from '@suite-native/trading-browser-auth'; import { selectExchangeSelectedSendAccount } from '@suite-native/trading-state'; @@ -27,7 +26,7 @@ export type TradingExchangeConfirmTradeProps = { export type TradingExchangeSignAndSendTransactionProps = { nextStep: () => void; - onError: (error: TradingSendRejectedProps) => void; + onError: (error: TradingSendRejectedProps) => void; }; export const useExchangeFlow = () => { diff --git a/suite-native/state/mocks/mockInitialAppState.ts b/suite-native/state/mocks/mockInitialAppState.ts index 9698dca34d..e3ceae5219 100644 --- a/suite-native/state/mocks/mockInitialAppState.ts +++ b/suite-native/state/mocks/mockInitialAppState.ts @@ -8,7 +8,7 @@ import { messageSystemInitialState } from '@suite-common/message-system'; import { initialSuiteSyncDataState, initialSuiteSyncState } from '@suite-common/suite-sync'; import { quotaManagerInitialState } from '@suite-common/suite-sync-quota-manager'; import { initialThpState } from '@suite-common/thp'; -import { notificationsInitialState } from '@suite-common/toast-notifications'; +import { createNotificationsReducer } from '@suite-common/toast-notifications'; import { tokenDefinitionsInitialState } from '@suite-common/token-definitions'; import { accountsInitialState, @@ -30,7 +30,7 @@ import { deviceOnboardingSliceInitialState } from '@suite-native/device-onboardi import { featureFlagsInitialState } from '@suite-native/feature-flags'; import { nativeFirmwareInitialState } from '@suite-native/firmware'; import { graphInitialState } from '@suite-native/graph'; -import { localeInitialState } from '@suite-native/intl'; +import { TxKeyPath, localeInitialState } from '@suite-native/intl'; import { appSettingsInitialState } from '@suite-native/settings'; import { tradingInitialState } from '@suite-native/trading-state'; import { sendFormInitialState } from '@suite-native/transaction-management'; @@ -60,7 +60,7 @@ export const mockInitialAppState = (partialState?: Partial): FullA logs: logsSliceInitialState, messageSystem: messageSystemInitialState, nativeFirmware: nativeFirmwareInitialState, - notifications: notificationsInitialState, + notifications: createNotificationsReducer().initialState, suiteSync: initialSuiteSyncState, suiteSyncData: initialSuiteSyncDataState, thp: initialThpState, diff --git a/suite-native/state/src/reducers.ts b/suite-native/state/src/reducers.ts index 84624e5220..7ff7fa3e90 100644 --- a/suite-native/state/src/reducers.ts +++ b/suite-native/state/src/reducers.ts @@ -14,7 +14,7 @@ import { import { suiteSyncDataReducer, suiteSyncReducer } from '@suite-common/suite-sync'; import { suiteSyncQuotaManagerReducer } from '@suite-common/suite-sync-quota-manager'; import { prepareThpReducer } from '@suite-common/thp'; -import { notificationsReducer } from '@suite-common/toast-notifications'; +import { createNotificationsReducer } from '@suite-common/toast-notifications'; import { prepareTokenDefinitionsReducer } from '@suite-common/token-definitions'; import { feesReducer, @@ -40,7 +40,7 @@ import { deviceOnboardingReducer } from '@suite-native/device-onboarding'; import { featureFlagsPersistedKeys, featureFlagsReducer } from '@suite-native/feature-flags'; import { nativeFirmwareReducer } from '@suite-native/firmware'; import { graphPersistTransform, graphReducer } from '@suite-native/graph'; -import { localePersistWhitelist, localeReducer } from '@suite-native/intl'; +import { TxKeyPath, localePersistWhitelist, localeReducer } from '@suite-native/intl'; import { appSettingsPersistWhitelist, appSettingsReducer } from '@suite-native/settings'; import { MMKVStorageDep, @@ -350,7 +350,7 @@ export const prepareRootReducers = (deps: PrepareRootReducersDeps) => { logs: logsSlice.reducer, messageSystem: messageSystemPersistedReducer, nativeFirmware: nativeFirmwareReducer, - notifications: notificationsReducer, + notifications: createNotificationsReducer().reducer, suiteSync: suiteSyncPersistedReducer, suiteSyncData: suiteSyncDataReducer, thp: thpPersistedReducer, diff --git a/yarn.lock b/yarn.lock index 2c3f142530..cf23c0d013 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11691,7 +11691,6 @@ __metadata: "@suite-common/metadata-types": "workspace:*" "@suite-common/wallet-config": "workspace:*" "@suite-common/wallet-constants": "workspace:*" - "@suite/intl": "workspace:*" "@trezor/blockchain-link-types": "workspace:*" "@trezor/connect": "workspace:*" "@trezor/type-utils": "workspace:*"