From 5d6164973e92fa8a3e3c18a0eb2e29494aea4f48 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sun, 9 Dec 2018 20:48:25 +0100 Subject: Fix linting issues --- src/features/delayApp/Component.js | 19 +++++++++++-------- src/features/delayApp/index.js | 1 - 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/features/delayApp') diff --git a/src/features/delayApp/Component.js b/src/features/delayApp/Component.js index 403340c7b..5c6ceaf86 100644 --- a/src/features/delayApp/Component.js +++ b/src/features/delayApp/Component.js @@ -6,7 +6,7 @@ import injectSheet from 'react-jss'; import Button from '../../components/ui/Button'; -import { config } from './'; +import { config } from '.'; import styles from './styles'; const messages = defineMessages({ @@ -38,10 +38,14 @@ export default @inject('actions') @injectSheet(styles) @observer class DelayApp countdown: config.delayDuration, } + countdownInterval = null; + + countdownIntervalTimeout = 1000; + componentDidMount() { this.countdownInterval = setInterval(() => { this.setState({ - countdown: this.state.countdown - this.countdownIntervalTimeout, + countdown: prevState => ({ value: prevState.countdown - this.countdownIntervalTimeout }), }); if (this.state.countdown <= 0) { @@ -55,9 +59,6 @@ export default @inject('actions') @injectSheet(styles) @observer class DelayApp clearInterval(this.countdownInterval); } - countdownInterval = null; - countdownIntervalTimeout = 1000; - render() { const { classes, actions } = this.props; const { intl } = this.context; @@ -71,9 +72,11 @@ export default @inject('actions') @injectSheet(styles) @observer class DelayApp buttonType="inverted" onClick={() => actions.ui.openSettings({ path: 'user' })} /> -

{intl.formatMessage(messages.text, { - seconds: this.state.countdown / 1000, - })}

+

+ {intl.formatMessage(messages.text, { + seconds: this.state.countdown / 1000, + })} +

); } diff --git a/src/features/delayApp/index.js b/src/features/delayApp/index.js index 9ffa1d2fd..d5c544b78 100644 --- a/src/features/delayApp/index.js +++ b/src/features/delayApp/index.js @@ -67,4 +67,3 @@ export default function init(stores) { } export const Component = DelayAppComponent; - -- cgit v1.2.3-70-g09d2