Changeset View
Changeset View
Standalone View
Standalone View
web/cashtab-components/src/hoc/CashtabBase/CashtabBase.tsx
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | return class extends React.Component<CashtabBaseProps, IState> { | ||||
this.setState({ step: 'fresh' }); | this.setState({ step: 'fresh' }); | ||||
return window.postMessage( | return window.postMessage( | ||||
{ | { | ||||
type: 'FROM_PAGE', | type: 'FROM_PAGE', | ||||
text: 'CashTab', | text: 'CashTab', | ||||
txInfo: { | txInfo: { | ||||
address: to, | address: to, | ||||
value: satoshis ? satoshis! / 1e8 : amount, | value: satoshis | ||||
? parseFloat( | |||||
( | |||||
satoshis! * | |||||
10 ** (-1 * Ticker.coinDecimals) | |||||
).toFixed(2), | |||||
) | |||||
: amount, | |||||
}, | }, | ||||
}, | }, | ||||
'*', | '*', | ||||
); | ); | ||||
} | } | ||||
const sendParams: sendParamsArr = { | const sendParams: sendParamsArr = { | ||||
to, | to, | ||||
▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | return class extends React.Component<CashtabBaseProps, IState> { | ||||
coinSymbol: symbol, | coinSymbol: symbol, | ||||
coinDecimals: decimals, | coinDecimals: decimals, | ||||
coinName: name, | coinName: name, | ||||
}); | }); | ||||
} | } | ||||
}; | }; | ||||
confirmCashTabProviderStatus = () => { | confirmCashTabProviderStatus = () => { | ||||
console.log(`confirmCashTabProviderStatus called`); | |||||
const cashTabStatus = this.getCashTabProviderStatus(); | const cashTabStatus = this.getCashTabProviderStatus(); | ||||
if (cashTabStatus) { | if (cashTabStatus) { | ||||
this.setState({ step: 'fresh' }); | this.setState({ step: 'fresh' }); | ||||
} | } | ||||
}; | }; | ||||
async componentDidMount() { | async componentDidMount() { | ||||
if (typeof window !== 'undefined') { | if (typeof window !== 'undefined') { | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |