Skip to content

Commit

Permalink
Improve transaction complete popup (#16300)
Browse files Browse the repository at this point in the history
* modified transaction complete popup

deleted upperCase function

deleted replaceAll

fixed lint

* resolved conflicts

* modified view const

Co-authored-by: Vladimir Saric <[email protected]>
  • Loading branch information
adnansahovic and VSaric authored Jan 4, 2023
1 parent 23653f4 commit 54cbc66
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/scripts/platforms/extension.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import browser from 'webextension-polyfill';

import { getBlockExplorerLink } from '@metamask/etherscan-link';
import { startCase, toLower } from 'lodash';
import { getEnvironmentType } from '../lib/util';
import { ENVIRONMENT_TYPE_BACKGROUND } from '../../../shared/constants/app';
import { TRANSACTION_STATUSES } from '../../../shared/constants/transaction';
import { getURLHostName } from '../../../ui/helpers/utils/util';

export default class ExtensionPlatform {
//
Expand Down Expand Up @@ -160,10 +162,13 @@ export default class ExtensionPlatform {

const url = getBlockExplorerLink(txMeta, rpcPrefs);
const nonce = parseInt(txMeta.txParams.nonce, 16);
const view = startCase(
toLower(getURLHostName(url).replace(/([.]\w+)$/u, '')),
);

const title = 'Confirmed transaction';
const message = `Transaction ${nonce} confirmed! ${
url.length ? 'View on Etherscan' : ''
url.length ? `View on ${view}` : ''
}`;
this._showNotification(title, message, url);
}
Expand Down

0 comments on commit 54cbc66

Please sign in to comment.