diff --git a/app/components/Activity/Countdown.js b/app/components/Activity/Countdown.js index fcc7beea..f39db7a8 100644 --- a/app/components/Activity/Countdown.js +++ b/app/components/Activity/Countdown.js @@ -26,20 +26,23 @@ class Countdown extends React.Component { } componentWillUnmount() { + const { interval } = this.state // use interval from the state to clear the interval - clearInterval(this.state.interval) + clearInterval(interval) } timerInterval() { const convertTwoDigits = n => (n > 9 ? n : `0${n}`.slice(-2)) const now = new Date().getTime() - const countDownSeconds = this.props.countDownDate * 1000 + const { countDownDate } = this.props + const countDownSeconds = countDownDate * 1000 const distance = countDownSeconds - now if (distance <= 0) { this.setState({ expired: true }) - clearInterval(this.state.interval) + const { interval } = this.state + clearInterval(interval) return } diff --git a/app/components/Contacts/Network.js b/app/components/Contacts/Network.js index 3185b49d..ba926c54 100644 --- a/app/components/Contacts/Network.js +++ b/app/components/Contacts/Network.js @@ -149,7 +149,7 @@ class Network extends Component { } const usdAmount = btc.satoshisToUsd(balance.channelBalance, currentTicker.price_usd) - + const { refreshing } = this.state return (
@@ -202,7 +202,7 @@ class Network extends Component { this.repeat = ref }} > - {this.state.refreshing ? : 'Refresh'} + {refreshing ? : 'Refresh'}
diff --git a/app/components/GlobalError/GlobalError.js b/app/components/GlobalError/GlobalError.js index 03457d17..3854b916 100644 --- a/app/components/GlobalError/GlobalError.js +++ b/app/components/GlobalError/GlobalError.js @@ -5,8 +5,9 @@ import styles from './GlobalError.scss' class GlobalError extends React.Component { componentDidUpdate(prevProps) { - if (!prevProps.error && this.props.error) { - setTimeout(this.props.clearError, 10000) + const { clearError, error } = this.props + if (!prevProps.error && error) { + setTimeout(clearError, 10000) } } diff --git a/app/components/Onboarding/ReEnterSeed.js b/app/components/Onboarding/ReEnterSeed.js index 3a6b7298..df602252 100644 --- a/app/components/Onboarding/ReEnterSeed.js +++ b/app/components/Onboarding/ReEnterSeed.js @@ -4,7 +4,8 @@ import styles from './ReEnterSeed.scss' class ReEnterSeed extends React.Component { componentWillMount() { - this.props.setReEnterSeedIndexes() + const { setReEnterSeedIndexes } = this.props + setReEnterSeedIndexes() } render() { diff --git a/app/components/Wallet/ReceiveModal.js b/app/components/Wallet/ReceiveModal.js index 73b1728d..323a8a5f 100644 --- a/app/components/Wallet/ReceiveModal.js +++ b/app/components/Wallet/ReceiveModal.js @@ -26,7 +26,8 @@ class ReceiveModal extends React.Component { } const changeQrCode = () => { - if (this.state.qrCodeType === 1) { + const { qrCodeType } = this.state + if (qrCodeType === 1) { this.setState({ qrCodeType: 2 }) } else { this.setState({ qrCodeType: 1 })