Skip to content

Commit

Permalink
fix: select correct label for receiver device when sending to differe…
Browse files Browse the repository at this point in the history
…nt device
  • Loading branch information
peter-sanderson committed Dec 18, 2024
1 parent 7d33220 commit f81e70e
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { useCallback } from 'react';

import styled from 'styled-components';

import { selectSelectedDeviceLabelOrName } from '@suite-common/wallet-core';

import { TrezorDevice } from 'src/types/suite';
import { useTranslation } from 'src/hooks/suite/useTranslation';
import { useSelector } from 'src/hooks/suite/useSelector';
Expand Down Expand Up @@ -38,7 +36,6 @@ export const useWalletLabeling = () => {

export const useGetWalletLabel = ({ device, shouldUseDeviceLabel }: WalletLabellingProps) => {
const { defaultAccountLabelString } = useWalletLabeling();
const deviceLabel = useSelector(selectSelectedDeviceLabelOrName);
const { walletLabel } = useSelector(state => selectLabelingDataForWallet(state, device.state));

let label: string | undefined;
Expand All @@ -49,6 +46,8 @@ export const useGetWalletLabel = ({ device, shouldUseDeviceLabel }: WalletLabell
}

if (shouldUseDeviceLabel) {
const deviceLabel = device?.features?.label || device?.name || '';

return <>{`${deviceLabel} ${label}`}</>;
}

Expand Down

0 comments on commit f81e70e

Please sign in to comment.