minor eslint fixes

This commit is contained in:
Mikhail Mikheev 2019-03-19 18:34:17 +04:00
parent 5c358764d1
commit 2b968d53da
3 changed files with 10 additions and 8 deletions

View File

@ -79,7 +79,7 @@ class Layout extends React.Component<Props, State> {
copyAddress = () => {
const { safe } = this.props
if (safe.address) {
copyToClipboard(safe.address)
}

View File

@ -14,23 +14,26 @@ const TIMEOUT = process.env.NODE_ENV === 'test' ? 1500 : 15000
class SafeView extends React.PureComponent<Props> {
componentDidMount() {
this.props.fetchSafe(this.props.safeUrl)
this.props.fetchTokens(this.props.safeUrl)
const { safeUrl, fetchTokens, fetchSafe } = this.props
fetchSafe(safeUrl)
fetchTokens(safeUrl)
this.intervalId = setInterval(() => {
const { safeUrl, fetchTokens, fetchSafe } = this.props
fetchTokens(safeUrl)
fetchSafe(safeUrl)
}, TIMEOUT)
}
componentDidUpdate(prevProps) {
const { safe, fetchTokens } = this.props
if (prevProps.safe) {
return
}
if (this.props.safe) {
const safeAddress = this.props.safe.get('address')
this.props.fetchTokens(safeAddress)
if (safe) {
const safeAddress = safe.get('address')
fetchTokens(safeAddress)
}
}

View File

@ -9,4 +9,3 @@ export const logComponentStack = (error: Error, info: Info) => {
// eslint-disable-next-line
console.log(info.componentStack)
}