fix: a saved SuccessTx in another shape reopens as itself, and long amounts wrap (closes #740)
The popup refused a saved SuccessTx whose decoded record was in a shape it did not expect, and showed Home. SuccessTx already shows only the lines it can read, so the popup no longer checks the record first. A long amount or token symbol was cut off at the edge of the screen. These now wrap: - the Amount figure - each decoded amount - the token symbol - the name and description of SuccessTx's decoded action WaitTx and ErrorTx share the line that shows the symbol, so they gain this too. Model: opus-5-5
This commit was merged in pull request #742.
This commit is contained in:
@@ -116,21 +116,6 @@ function isAddressText(value) {
|
||||
return isText(value);
|
||||
}
|
||||
|
||||
// Decoded calldata, as decodedDetailsHtml() (src/popup/views/txStatus.js)
|
||||
// walks it: `for (const d of decoded.details)` needs an iterable, and each
|
||||
// entry's `address` reaches toAddressHtml(). Absent or falsy is the ordinary
|
||||
// case and short-circuits before either.
|
||||
function isRenderableDecoded(value) {
|
||||
if (!value) return true;
|
||||
if (!isRecord(value)) return false;
|
||||
if (!value.details) return true;
|
||||
if (!Array.isArray(value.details)) return false;
|
||||
return value.details.every(
|
||||
(entry) =>
|
||||
isRecord(entry) && (!entry.address || isAddressText(entry.address)),
|
||||
);
|
||||
}
|
||||
|
||||
// The pending transaction confirmTx.show() renders: `token` reaches
|
||||
// renderAddressHtml() when it is not "ETH", `from`/`to` reach
|
||||
// addressTitle(), makeBlockie() and getLocalWarnings(), and `amount` reaches
|
||||
@@ -209,7 +194,6 @@ function renderView(view, state, views) {
|
||||
case "success-tx":
|
||||
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)) {
|
||||
|
||||
Reference in New Issue
Block a user