From 59197fb36869def25bc0b3bdf99ef5553dac0673 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 24 Sep 2020 13:17:14 +0800 Subject: [PATCH] Fix multisig signed instruction formatting on explorer (#12439) --- .../instruction/token/TokenDetailsCard.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/explorer/src/components/instruction/token/TokenDetailsCard.tsx b/explorer/src/components/instruction/token/TokenDetailsCard.tsx index e96974b848..61b28f63ca 100644 --- a/explorer/src/components/instruction/token/TokenDetailsCard.tsx +++ b/explorer/src/components/instruction/token/TokenDetailsCard.tsx @@ -132,6 +132,24 @@ function TokenInstruction(props: InfoProps) { let value = props.info[key]; if (value === undefined) continue; + // Flatten lists of public keys + if (Array.isArray(value) && value.every((v) => v instanceof PublicKey)) { + for (let i = 0; i < value.length; i++) { + let publicKey = value[i]; + let label = `${key.charAt(0).toUpperCase() + key.slice(1)} - #${i + 1}`; + + attributes.push( + + {label} + +
+ + + ); + } + continue; + } + if (key === "tokenAmount") { key = "amount"; value = (value as TokenAmountUi).amount;