fix: SuccessTx and ErrorTx link to the explorer of the network the transaction was sent on (closes #622)
SuccessTx and ErrorTx built their recipient, block, hash and decoded-action address links for the active network. After a network switch, WaitTx now finds a transaction on the network it was sent on and moves on to these screens, whose links then opened an explorer where the transaction does not exist. Both screens now keep the transaction's chain id with their view data and build every link for that network, as WaitTx does. A stored SuccessTx or ErrorTx whose chain id names no network is refused on restore, as a stored transaction already is. Model: opus-5-5
This commit was merged in pull request #624.
This commit is contained in:
@@ -205,11 +205,19 @@ function renderView(view, state, views) {
|
||||
if (!data.hash) return false;
|
||||
if (!isAddressText(data.to)) return false;
|
||||
if (!isRenderableDecoded(data.decoded)) return false;
|
||||
// `chainId` picks the network whose explorer the links open, so
|
||||
// when it is there it has to name one. Likewise on error-tx.
|
||||
if (data.chainId && !SUPPORTED_CHAIN_IDS.has(data.chainId)) {
|
||||
return false;
|
||||
}
|
||||
views.txStatus.renderSuccess();
|
||||
return true;
|
||||
case "error-tx":
|
||||
if (!data.message) return false;
|
||||
if (!isAddressText(data.to)) return false;
|
||||
if (data.chainId && !SUPPORTED_CHAIN_IDS.has(data.chainId)) {
|
||||
return false;
|
||||
}
|
||||
views.txStatus.renderError();
|
||||
return true;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user