From f3f226afdff656d108e5db20f9ddbb0ab8a39571 Mon Sep 17 00:00:00 2001 From: Alexander Kolotov Date: Thu, 6 Aug 2020 23:43:13 +0300 Subject: [PATCH] Correction of the message for a transaction without the bridge requests (#416) --- alm/src/components/StatusContainer.tsx | 23 +++++++++++++++++------ alm/src/config/descriptions.ts | 3 ++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/alm/src/components/StatusContainer.tsx b/alm/src/components/StatusContainer.tsx index bd96d778..c5d9e9ef 100644 --- a/alm/src/components/StatusContainer.tsx +++ b/alm/src/components/StatusContainer.tsx @@ -64,10 +64,6 @@ export const StatusContainer = ({ onBackToMain, setNetworkFromParams, receiptPar const displayReference = multiMessageSelected ? messages[selectedMessageId].id : txHash const formattedMessageId = formatTxHash(displayReference) - const displayedDescription = multiMessageSelected - ? getTransactionStatusDescription(TRANSACTION_STATUS.SUCCESS_ONE_MESSAGE, timestamp) - : description - const isHome = chainId === home.chainId.toString() const txExplorerLink = getExplorerTxUrl(txHash, isHome) const displayExplorerLink = status !== TRANSACTION_STATUS.NOT_FOUND @@ -75,17 +71,32 @@ export const StatusContainer = ({ onBackToMain, setNetworkFromParams, receiptPar const displayConfirmations = status === TRANSACTION_STATUS.SUCCESS_ONE_MESSAGE || multiMessageSelected const messageToConfirm = messages.length > 1 ? messages[selectedMessageId] : messages.length > 0 ? messages[0] : { id: '', data: '' } + + let displayedDescription: string = multiMessageSelected + ? getTransactionStatusDescription(TRANSACTION_STATUS.SUCCESS_ONE_MESSAGE, timestamp) + : description + let link + const descArray = displayedDescription.split('%link') + if (descArray.length > 1) { + displayedDescription = descArray[0] + link = ( + + {descArray[1]} + + ) + } + return (
{status && (

- The request{' '} + The transaction{' '} {displayExplorerLink && ( {formattedMessageId} )} - {!displayExplorerLink && } {displayedDescription} + {!displayExplorerLink && } {displayedDescription} {link}

)} {displayMessageSelector && } diff --git a/alm/src/config/descriptions.ts b/alm/src/config/descriptions.ts index d030db50..dd2ed174 100644 --- a/alm/src/config/descriptions.ts +++ b/alm/src/config/descriptions.ts @@ -2,7 +2,8 @@ export const TRANSACTION_STATUS_DESCRIPTION: { [key: string]: string } = { SUCCESS_MULTIPLE_MESSAGES: 'was initiated %t and contains several bridge messages. Specify one of them:', SUCCESS_ONE_MESSAGE: 'was initiated %t', - SUCCESS_NO_MESSAGES: 'execution succeeded %t but it does not contain any bridge messages', + SUCCESS_NO_MESSAGES: + 'successfully mined %t but it does not seem to contain any request to the bridge, \nso nothing needs to be confirmed by the validators. \nIf you are sure that the transaction should contain a request to the bridge,\ncontact to the validators by \nmessaging on %linkhttps://forum.poa.network/c/support', FAILED: 'failed %t', NOT_FOUND: 'Transaction not found. \n1. Check that the transaction hash is correct. \n2. Wait several blocks for the transaction to be\nmined, gas price affects mining speed.'