Skip to content

Commit

Permalink
Don't do array check
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Tideman committed Jan 31, 2025
1 parent b4cef17 commit 4e0801b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/lib/components/event/payload-decoder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@
},
};
const formatFromArray = (value: unknown): string => {
if (Array.isArray(value) && value.length === 1) {
return stringifyWithBigInt(value[0]);
}
return stringifyWithBigInt(value);
};
const decodePayloads = async (
_value: PotentiallyDecodable | EventAttribute | WorkflowEvent | Memo,
) => {
Expand All @@ -61,7 +54,11 @@
convertedAttributes,
) as object;
const keyExists = key && decodedAttributes?.[key];
decodedValue = formatFromArray(keyExists || decodedAttributes);
if (keyExists) {
decodedValue = stringifyWithBigInt(keyExists);
} else {
decodedValue = stringifyWithBigInt(decodedAttributes);
}
if (onDecode) {
onDecode(decodedValue);
Expand Down

0 comments on commit 4e0801b

Please sign in to comment.