Skip to content

Commit fd08bd7

Browse files
authored
disable explorer btn on tx when no explorer (#1475)
1 parent aa3d5f5 commit fd08bd7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

app/tray/Account/Requests/style/index.styl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,13 @@
698698

699699
.txActionButtonBad
700700
color var(--bad)
701+
702+
.txActionButtonDisabled
703+
color var(--outerspace05)
704+
cursor default
705+
706+
.txActionButtonDisabled:hover
707+
background var(--ghostA)
701708

702709
.requestApproveFeeReject
703710
color var(--moon)

app/tray/Footer/RequestCommand/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class RequestCommand extends React.Component {
6262
id: parseInt(req.data.chainId, 'hex')
6363
}
6464

65-
const isTestnet = this.store('main.networks', chain.type, chain.id, 'isTestnet')
65+
const { isTestnet, explorer } = this.store('main.networks', chain.type, chain.id)
6666
const nativeCurrency = this.store('main.networksMeta', chain.type, chain.id, 'nativeCurrency')
6767
const nativeUSD = nativeCurrency && nativeCurrency.usd && !isTestnet ? nativeCurrency.usd.price : 0
6868

@@ -108,9 +108,9 @@ class RequestCommand extends React.Component {
108108
) : this.state.showHashDetails || status === 'confirming' ? (
109109
<div className='txActionButtonsRow'>
110110
<div
111-
className={'txActionButton'}
111+
className={`txActionButton${explorer ? '' : ' txActionButtonDisabled'}`}
112112
onClick={() => {
113-
if (req && req.tx && req.tx.hash) {
113+
if (explorer && req && req.tx && req.tx.hash) {
114114
if (this.store('main.mute.explorerWarning')) {
115115
link.send('tray:openExplorer', chain, req.tx.hash)
116116
} else {

0 commit comments

Comments
 (0)