Skip to content

Commit

Permalink
fix(suite): bitcoincash prefix
Browse files Browse the repository at this point in the history
(cherry picked from commit c62f5c2)
  • Loading branch information
AdamSchinzel authored and komret committed Dec 18, 2023
1 parent 9dd6732 commit a4ee73c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/suite/src/components/suite/DeviceDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ export const DeviceDisplay = ({ address, network, valueDataTest }: DeviceDisplay

if (!selectedDeviceInternalModel) return null;

const isPaginated = MAX_CHARACTERS_ON_SCREEN[selectedDeviceInternalModel] <= address.length;
// remove bitcoincash: prefix
const processedAddress = address.startsWith('bitcoincash:')
? address.replace('bitcoincash:', '')
: address;

const isPaginated =
MAX_CHARACTERS_ON_SCREEN[selectedDeviceInternalModel] <= processedAddress.length;
const areChunksUsed =
addressDisplayType === AddressDisplayOptions.CHUNKED &&
!unavailableCapabilities?.chunkify &&
Expand Down Expand Up @@ -196,5 +202,9 @@ export const DeviceDisplay = ({ address, network, valueDataTest }: DeviceDisplay
return <Text isPixelType={isPixelType}>{address}</Text>;
};

return <Display>{areChunksUsed ? renderChunks(address) : renderOriginal(address)}</Display>;
return (
<Display>
{areChunksUsed ? renderChunks(processedAddress) : renderOriginal(processedAddress)}
</Display>
);
};

0 comments on commit a4ee73c

Please sign in to comment.