Commit d34fc554 authored by tom's avatar tom

tx info: tac operation stage could be an array

parent 26b37264
...@@ -22,11 +22,11 @@ export function getTacOperationStatus(type: tac.OperationType) { ...@@ -22,11 +22,11 @@ export function getTacOperationStatus(type: tac.OperationType) {
} }
export function getTacOperationStage(data: tac.OperationDetails, txHash: string) { export function getTacOperationStage(data: tac.OperationDetails, txHash: string) {
const currentStep = data.status_history.find((step) => step.transactions.some((tx) => tx.hash.toLowerCase() === txHash.toLowerCase())); const currentStep = data.status_history.filter((step) => step.transactions.some((tx) => tx.hash.toLowerCase() === txHash.toLowerCase()));
if (!currentStep) { if (currentStep.length === 0) {
return null; return;
} }
return STATUS_LABELS[currentStep.type]; return currentStep.map((step) => STATUS_LABELS[step.type]);
} }
export const STATUS_SEQUENCE: Array<tac.OperationStage_StageType> = [ export const STATUS_SEQUENCE: Array<tac.OperationStage_StageType> = [
......
...@@ -35,7 +35,7 @@ const TxDetailsTacOperation = ({ tacOperations, isLoading, txHash }: Props) => { ...@@ -35,7 +35,7 @@ const TxDetailsTacOperation = ({ tacOperations, isLoading, txHash }: Props) => {
> >
{ tacOperations.map((tacOperation) => { { tacOperations.map((tacOperation) => {
const tags = [ const tags = [
getTacOperationStage(tacOperation, txHash), ...(getTacOperationStage(tacOperation, txHash) || []),
getTacOperationStatus(tacOperation.type), getTacOperationStatus(tacOperation.type),
]; ];
...@@ -46,8 +46,8 @@ const TxDetailsTacOperation = ({ tacOperations, isLoading, txHash }: Props) => { ...@@ -46,8 +46,8 @@ const TxDetailsTacOperation = ({ tacOperations, isLoading, txHash }: Props) => {
isLoading={ isLoading } isLoading={ isLoading }
/> />
{ tags.length > 0 && ( { tags.length > 0 && (
<HStack flexShrink={ 0 }> <HStack flexShrink={ 0 } flexWrap="wrap">
{ tags.map((tag) => <Tag key={ tag } loading={ isLoading }>{ tag }</Tag>) } { tags.map((tag) => <Tag key={ tag } loading={ isLoading } flexShrink={ 0 }>{ tag }</Tag>) }
</HStack> </HStack>
) } ) }
</HStack> </HStack>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment