1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

ArticleListに自動scroll機能追加

This commit is contained in:
Rokt33r
2015-11-01 02:37:22 +09:00
parent d338f217fe
commit 522c0edd90
3 changed files with 32 additions and 3 deletions

View File

@@ -33,6 +33,14 @@ export default class ArticleDetail extends React.Component {
}
}
componentDidMount () {
this.refreshTimer = setInterval(() => this.forceUpdate(), 60 * 1000)
}
componentWillUnmount () {
clearInterval(this.refreshTimer)
}
componentDidUpdate (prevProps) {
let isModeChanged = prevProps.status.mode !== this.props.status.mode
if (isModeChanged && this.props.status.mode !== IDLE_MODE) {