Repository: trezor/trezor-suite
Pull request #17609: fix(suite): when switching the device, make sure that the correspondi…
Author: login: vojtatranta
Labels: name: QA NOK
description: Issue doesn't pass the QA and some changes are needed.
Created: 2025-03-12T14:36:45Z | Merged: 2025-03-17T14:33:17Z

…ng account exists on the other device wallet

<!--- Provide a general summary of your changes in the Title above -->

## Description

When you are in a device / wallet on /btc/4/ account and you switch to a different device / wallet that doesn't have /btc/4 but like just 1 btc account, it ended up in "Accout not found".

In this PR, I first check if that account existss

## Related Issue

Resolve https://github.com/trezor/trezor-suite/issues/4465

## Screenshots:



Diff:
diff --git a/packages/suite/src/actions/wallet/addWalletThunk.ts b/packages/suite/src/actions/wallet/addWalletThunk.ts
index 01c101798139..6e64b36c76a1 100644
--- a/packages/suite/src/actions/wallet/addWalletThunk.ts
+++ b/packages/suite/src/actions/wallet/addWalletThunk.ts
@@ -16,25 +16,35 @@ import { getBackgroundRoute } from 'src/utils/suite/router';
 import { getDiscoveryStatus } from '../../utils/wallet/getDiscoveryStatus';
 import { goto } from '../suite/routerActions';
 
-export const redirectAfterWalletSelectedThunk = createThunk<void, void, void>(
-    `${DEVICE_MODULE_PREFIX}/redirectAfterWalletSelectedThunk`,
-    async (_, { dispatch }) => {
-        const backgroundRoute = getBackgroundRoute();
-        // Preserve route for dashboard or wallet context only. Redirect from other routes to dashboard index.
-        const isWalletOrDashboardContext =
-            backgroundRoute && ['wallet', 'dashboard'].includes(backgroundRoute.app);
-        if (!isWalletOrDashboardContext) {
-            await dispatch(goto('suite-index'));
-        }
+export const redirectAfterWalletSelectedThunk = createThunk<
+    void,
+    { forceDeviceDashboard?: boolean } | undefined,
+    void
+>(`${DEVICE_MODULE_PREFIX}/redirectAfterWalletSelectedThunk`, async (options, { dispatch }) => {
+    const backgroundRoute = getBackgroundRoute();
 
-        // Subpaths of wallet are not available to all account types (e.g. Tokens tab not available to BTC accounts).
-        const isWalletSubpath =
-            backgroundRoute?.app === 'wallet' && backgroundRoute?.name !== 'wallet-index';
-        if (isWalletSubpath) {
-            await dispatch(goto('wallet-index'));
-        }
-    },
-);
+    // NOTE: the URL is being static when you switch device like /btc/4/norma
+    // when you switch to other device (wallet), there might not be /btc/4, but just /btc/1
+    // this causes Account not found error, so we allow this option
+    if (options?.forceDeviceDashboard) {
+        dispatch(goto('suite-index'));
+
+        return;
+    }
+    // Preserve route for dashboard or wallet context only. Redirect from other routes to dashboard index.
+    const isWalletOrDashboardContext =
+        backgroundRoute && ['wallet', 'dashboard'].includes(backgroundRoute.app);
+    if (!isWalletOrDashboardContext) {
+        await dispatch(goto('suite-index'));
+    }
+
+    // Subpaths of wallet are not available to all account types (e.g. Tokens tab not available to BTC accounts).
+    const isWalletSubpath =
+        backgroundRoute?.app === 'wallet' && backgroundRoute?.name !== 'wallet-index';
+    if (isWalletSubpath) {
+        await dispatch(goto('wallet-index'));
+    }
+});
 
 export const addWalletThunk = createThunk<
     void,
diff --git a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx
index e55bb1b30b53..b3b39b1da22a 100644
--- a/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx
+++ b/packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx
@@ -2,6 +2,7 @@ import { useState } from 'react';
 
 import {
     createDiscoveryThunk,
+    getAccountsByDeviceState,
     selectCurrentFiatRates,
     selectDeviceThunk,
     selectDiscoveryByDeviceState,
@@ -45,6 +46,7 @@ export const WalletInstance = ({
 }: WalletInstanceProps) => {
     const [contentType, setContentType] = useState<null | ContentType>('default');
     const accounts = useSelector(state => state.wallet.accounts);
+    const selectedAccount = useSelector(state => state.wallet.selectedAccount);
     const currentFiatRates = useSelector(selectCurrentFiatRates);
     const localCurrency = useSelector(selectLocalCurrency);
     const editing = useSelector(state => state.metadata.editing);
@@ -78,8 +80,23 @@ export const WalletInstance = ({
     const handleClick = discoveryProcess
         ? () => {
               if (!editing) {
+                  const nextDeviceAccounts = instance.state
+                      ? getAccountsByDeviceState(accounts, instance.state)
+                      : [];
+
+                  // NOTE: attempt to determine, if the currently selected account
+                  // has a corresponding account in the next device accounts
+                  // if not, enforce switching URL to dashboard
+                  const nextAccount = nextDeviceAccounts.find(
+                      account =>
+                          account.symbol === selectedAccount.params?.symbol &&
+                          account.index === selectedAccount.params?.accountIndex,
+                  );
+
                   dispatch(selectDeviceThunk({ device: instance }));
-                  dispatch(redirectAfterWalletSelectedThunk());
+                  dispatch(
+                      redirectAfterWalletSelectedThunk({ forceDeviceDashboard: !nextAccount }),
+                  );
                   onCancel(false);
               }
           }


Reviews:
user: login: vojtatranta
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T14:50:52Z
user: login: vojtatranta
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T14:51:22Z
user: login: vojtatranta
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T14:51:51Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (1)</summary><blockquote>

<details>
<summary>packages/suite/src/actions/wallet/addWalletThunk.ts (1)</summary><blockquote>

`95-95`: **Call to redirectAfterWalletSelectedThunk is missing the new parameter**

The call to `redirectAfterWalletSelectedThunk()` in `addWalletThunk` doesn't pass any arguments while the function now expects an optional parameter. This likely won't cause issues since the parameter is optional, but for consistency, consider passing an empty object or `undefined` explicitly.

```diff
-    dispatch(redirectAfterWalletSelectedThunk());
+    dispatch(redirectAfterWalletSelectedThunk({}));
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 5452b573461dcbef616d984438bf09d3ab30551a and 07cf05b4ba904481011e89c51d83453cfa2a78a1.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `packages/suite/src/actions/wallet/addWalletThunk.ts` (1 hunks)
* `packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx` (3 hunks)

</details>

<details>
<summary>🔇 Additional comments (6)</summary><blockquote>

<details>
<summary>packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx (4)</summary>

`5-5`: **Added a new import from wallet-core**

The new import `getAccountsByDeviceState` is correctly added to support the new account validation logic.

---

`49-49`: **Added Redux selector for selectedAccount**

This addition properly retrieves the currently selected account which is needed for the account validation check.

---

`83-95`: **Verify that the new device contains the corresponding account**

This logic appropriately checks whether the target device has a matching account to prevent the "Account not found" error. The account matching is performed by comparing both symbol and account index, which seems correct.

Regarding the past comment "is this correct way of finding 'corresponding' account to switch to?": Yes, matching by both `symbol` and `index` is the appropriate approach to find a corresponding account.

---

`97-99`: **Updated dispatch to redirect to dashboard when necessary**

The function now correctly passes the `forceDeviceDashboard` parameter to force redirection to the dashboard when a matching account doesn't exist on the target device.

</details>
<details>
<summary>packages/suite/src/actions/wallet/addWalletThunk.ts (2)</summary>

`19-23`: **Updated thunk signature to support forcing device dashboard redirection**

The function signature has been correctly updated to accept an optional options parameter that includes the `forceDeviceDashboard` flag.

---

`26-33`: **Added early return with dashboard redirection when needed**

This new logic properly handles the case when switching to a device that doesn't have the corresponding account by redirecting to the dashboard instead of showing an error.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-03-13T11:26:41Z
user: login: seibei-iguchi
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-17T12:31:53Z

Review comments:
diff_hunk: @@ -78,8 +80,23 @@ export const WalletInstance = ({
     const handleClick = discoveryProcess
         ? () => {
               if (!editing) {
+                  const nextDeviceAccounts = instance.state
+                      ? getAccountsByDeviceState(accounts, instance.state)
+                      : [];
+
+                  // NOTE: attempt to determine, if the currently selected account
+                  // has a corresponding account in the next device accounts
+                  // if not, enforce switching URL to dashboard
+                  const nextAccount = nextDeviceAccounts.find(
+                      account =>
path: packages/suite/src/views/suite/SwitchDevice/DeviceItem/WalletInstance.tsx
user: login: vojtatranta
body: is this correct way of finding "correspoding" accout to switch to?


created_at: 2025-03-12T14:50:52Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,10 +16,23 @@ import { getBackgroundRoute } from 'src/utils/suite/router';
 import { getDiscoveryStatus } from '../../utils/wallet/getDiscoveryStatus';
 import { goto } from '../suite/routerActions';
 
-export const redirectAfterWalletSelectedThunk = createThunk<void, void, void>(
+export const redirectAfterWalletSelectedThunk = createThunk<
+    void,
+    { forceDeviceDashboard?: boolean },
+    void
+>(
     `${DEVICE_MODULE_PREFIX}/redirectAfterWalletSelectedThunk`,
-    async (_, { dispatch }) => {
+    async ({ forceDeviceDashboard }, { dispatch }) => {
path: packages/suite/src/actions/wallet/addWalletThunk.ts
user: login: vojtatranta
body: This thunk was written by @seibei-iguchi I am not sure what it was suppose to do though.
created_at: 2025-03-12T14:51:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -16,10 +16,23 @@ import { getBackgroundRoute } from 'src/utils/suite/router';
 import { getDiscoveryStatus } from '../../utils/wallet/getDiscoveryStatus';
 import { goto } from '../suite/routerActions';
 
-export const redirectAfterWalletSelectedThunk = createThunk<void, void, void>(
+export const redirectAfterWalletSelectedThunk = createThunk<
+    void,
+    { forceDeviceDashboard?: boolean },
+    void
+>(
     `${DEVICE_MODULE_PREFIX}/redirectAfterWalletSelectedThunk`,
-    async (_, { dispatch }) => {
+    async ({ forceDeviceDashboard }, { dispatch }) => {
path: packages/suite/src/actions/wallet/addWalletThunk.ts
user: login: vojtatranta
body: Yeah, in some cases, it went to dashboard. 
created_at: 2025-03-12T14:51:51Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-03-13T11:26:38Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough
The changes update the redirection logic that follows a wallet selection. The `redirectAfterWalletSelectedThunk` function’s signature has been expanded to accept an optional parameter that can force redirection to the device dashboard. Internally, the function now checks this parameter and, if set, dispatches a navigation action to the dashboard immediately. Additionally, the existing logic for handling background routes remains intact. In parallel, the `WalletInstance` component has been modified to include a new function, `getAccountsByDeviceState`, which retrieves accounts based on the current device state, and it now also retrieves the `selectedAccount` from the Redux store. In the event that the selected account is not found among the accounts derived from the device state, the dispatch of `redirectAfterWalletSelectedThunk` incorporates the new parameter to enforce dashboard redirection.

<!-- walkthrough_end -->

<!-- announcements_start -->

> [!TIP]
> <details>
> <summary>⚡🧪 Multi-step agentic review comment chat (experimental)</summary>
> 
> - We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
> 						- To enable this feature, set early_access to true under in the settings.
> 
> </details>

<!-- announcements_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpADK2VmgqyjcEj2wAbb5AokAI7Y0riQ4rjedJAARABm8AAeABSI2OokAJRcAO6wZJCIOeoMCBhE4fmQShLwDCQANJDMaADWnmkBldSVnkwUAYjc+Bi08OXoDEzYGGEkiUi4yCO9/Lj5fDV1njloviS4MZC7yGkCzOo09HKQ2IiUkBL4QrjUVLNo6KMoyPBKs/AEtEbutPBgnAIHgBGADsADYAAwATg0MCqtnQtFog3uyEwPzSnjI01mlGieQKRRKZQqkNwORIBS29WWfF2+yWKCwoJgAQAXvg+I4MuhuNxvHVqPARhp3FVeIIosx0BQkNJjvksJ87g9UCtPkNRIC6pMSbgmmlSuhkAB6AS4Bg2gAsTUw9GoNGY3E5BEKxQdsHC+HQ1UBcTJs2qJFq9X4bL2UTC6x6tHw6ow+DCTA+41WiDQbFN+BmmkgAEksJbAww0Limjy0GKJTXxCscsXvPQxkNvGh5PiY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bcgJj2NWd0rZqMK6JleStDWXwyA6MHCyyp1j7HONG0Dtp9pG8AiRgTtZvE3xZW/gC0bFAv0jlMqWN41AiXVQpdWbcfln8Tw/zmT4hr7AuGFC9u290wUwjhxDLeaQ94xgTGa8+FN6XcCZZWwXBBv0D4baGCMbbFRduRlQJOPRWC7YNuhh65tCs20+1oP6wOpSAw2OjsaaIvpxgMG3BhT4His4PBtiO9jE6p1wMk1aVA9xZFKTsgUtL3Lys2ZsVsh7owBvICI+gCVp92kjCmluIFdjJIYAgTJAVeKGmBSqAkydsDknATUd9ELmTAFFyqOZpbynZkhYOz+bYYu9IitQ7rcnCqwFs88EoMHR985AJfIkYYKV1F8A1Vqti4grZPsgPFf5+osR0AdfR3HLG2NQI41xkTu630HqzUtL9Nof05D/UtAD1J2OgadxBiCUGFYwaE/BpYiR71QAAGpJZG5iJQtAHXZiKiLr7uPk1YD3emj92bve+/93dQPAZg/sbDxNATsHhMIfvch/VLM2afW+ObNAeA8aA0JtEEG7AuBUApthlw8gbgI2UMjRmaNW8YwUKwdQAB9P4iAl8LwYgyWgS/YPOregYefCIYQMDiAiNyAgnSqKRAiFyAAOKECIoRQhILfpEDA3JQloLfgAzE6Ny3+T80AAAmNAGEW/NAKEZmVmefEGZfVfdfOuNxOgJfL6KAoAA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=trezor/trezor-suite&utm_content=17609):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE
user: login: STew790
created_at: 2025-03-18T14:06:55Z
body: **QA NOK**
Unfortunately, I can still see the issue.
Switching from taproot account in passphrase to standard wallet (where the taproot is not present)
![image](https://github.com/user-attachments/assets/b7a7ca49-271b-4695-a5a6-665ae0b8f25c)

**Info:**
 - Suite version: web 25.4.0 (f255b2a9ec8d60b29239e27934815c31874d7275)
 - Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
 - OS: Linux x86_64
 - Screen: 3440x1440
 - Device: Trezor T2T1 2.8.9 regular (revision fad9682201cf9289bba2adb66e6e07ed1cf78936)
 - Transport: WebUsbTransport
author_association: CONTRIBUTOR
user: login: vojtatranta
created_at: 2025-03-18T14:37:45Z
body: > **QA NOK** Unfortunately, I can still see the issue. Switching from taproot account in passphrase to standard wallet (where the taproot is not present) ![image](https://private-user-images.githubusercontent.com/48477147/424018078-b7a7ca49-271b-4695-a5a6-665ae0b8f25c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDIzMDcyOTIsIm5iZiI6MTc0MjMwNjk5MiwicGF0aCI6Ii80ODQ3NzE0Ny80MjQwMTgwNzgtYjdhN2NhNDktMjcxYi00Njk1LWE1YTYtNjY1YWUwYjhmMjVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAzMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMzE4VDE0MDk1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU1ODYyNTBhYWM4Y2U2Yjc3M2E1OTNjYThmMjUyNTBjNjFiODA4YWNjYmRmZGZkNjhmMzQxYzNmZGJiYTU2NzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wjPFhcXq6RTTAxR4cV0YepmkkImd8Mj1OYpBjeFUI_w)
> 
> **Info:**
> 
> * Suite version: web 25.4.0 ([f255b2a](https://github.com/trezor/trezor-suite/commit/f255b2a9ec8d60b29239e27934815c31874d7275))
> * Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
> * OS: Linux x86_64
> * Screen: 3440x1440
> * Device: Trezor T2T1 2.8.9 regular (revision fad9682201cf9289bba2adb66e6e07ed1cf78936)
> * Transport: WebUsbTransport

fix here https://github.com/trezor/trezor-suite/pull/17748
author_association: CONTRIBUTOR
user: login: bosomt
created_at: 2025-03-20T10:10:37Z
body: **QA OK**

🎉 !!!

**Info:**
 - Suite version: web 25.4.0 (e5ccc0c45bf1c935d6c0c030e02452d2cacf234a)
 - Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
 - OS: MacIntel
 - Screen: 1470x956
 - Device: Trezor T3B1 2.8.9 regular (revision fad9682201cf9289bba2adb66e6e07ed1cf78936)
 - Transport: BridgeTransport 2.0.33
author_association: CONTRIBUTOR