Disable utf8 display when impossible to decode
This commit is contained in:
parent
d905afd75d
commit
05aee02a43
|
@ -30,9 +30,8 @@ const InputDecoder: React.FC<InputDecoderProps> = ({
|
|||
try {
|
||||
return toUtf8String(data);
|
||||
} catch (err) {
|
||||
console.warn("Error while converting input data to string");
|
||||
console.warn(err);
|
||||
return "<can't decode>";
|
||||
// Silently ignore on purpose
|
||||
return undefined;
|
||||
}
|
||||
}, [data]);
|
||||
|
||||
|
@ -41,7 +40,7 @@ const InputDecoder: React.FC<InputDecoderProps> = ({
|
|||
<Tab.List className="flex space-x-1 mb-1">
|
||||
<ModeTab disabled={!resolvedTxDesc}>Decoded</ModeTab>
|
||||
<ModeTab>Raw</ModeTab>
|
||||
<ModeTab>UTF-8</ModeTab>
|
||||
<ModeTab disabled={utfInput === undefined}>UTF-8</ModeTab>
|
||||
</Tab.List>
|
||||
<Tab.Panels>
|
||||
<Tab.Panel>
|
||||
|
|
Loading…
Reference in New Issue