diff options
author | vantezzen <hello@vantezzen.io> | 2019-10-06 15:09:32 +0200 |
---|---|---|
committer | vantezzen <hello@vantezzen.io> | 2019-10-06 15:09:32 +0200 |
commit | 26c075372a1bb461752c873cfed0a96b10a4bba9 (patch) | |
tree | 3eaf471910990e81b2d718e42c3e9e31bbdc6cd0 /src/components/services/content/ServiceView.js | |
parent | Merge pull request #102 from getferdi/l10n_master (diff) | |
download | ferdium-app-26c075372a1bb461752c873cfed0a96b10a4bba9.tar.gz ferdium-app-26c075372a1bb461752c873cfed0a96b10a4bba9.tar.zst ferdium-app-26c075372a1bb461752c873cfed0a96b10a4bba9.zip |
Add option to choose hibernation strategy
Diffstat (limited to 'src/components/services/content/ServiceView.js')
-rw-r--r-- | src/components/services/content/ServiceView.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/services/content/ServiceView.js b/src/components/services/content/ServiceView.js index 0cfefc92b..f6686548d 100644 --- a/src/components/services/content/ServiceView.js +++ b/src/components/services/content/ServiceView.js | |||
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; | |||
3 | import { autorun, reaction } from 'mobx'; | 3 | import { autorun, reaction } from 'mobx'; |
4 | import { observer, inject } from 'mobx-react'; | 4 | import { observer, inject } from 'mobx-react'; |
5 | import classnames from 'classnames'; | 5 | import classnames from 'classnames'; |
6 | import ms from 'ms'; | ||
7 | 6 | ||
8 | import ServiceModel from '../../../models/Service'; | 7 | import ServiceModel from '../../../models/Service'; |
9 | import StatusBarTargetUrl from '../../ui/StatusBarTargetUrl'; | 8 | import StatusBarTargetUrl from '../../ui/StatusBarTargetUrl'; |
@@ -104,11 +103,13 @@ export default @observer @inject('stores') class ServiceView extends Component { | |||
104 | }; | 103 | }; |
105 | 104 | ||
106 | startHibernationTimer() { | 105 | startHibernationTimer() { |
106 | const timerDuration = (Number(this.props.stores.settings.all.app.hibernationStrategy) || 300) * 1000; | ||
107 | |||
107 | const hibernationTimer = setTimeout(() => { | 108 | const hibernationTimer = setTimeout(() => { |
108 | this.setState({ | 109 | this.setState({ |
109 | hibernate: true, | 110 | hibernate: true, |
110 | }); | 111 | }); |
111 | }, ms('5m')); | 112 | }, timerDuration); |
112 | 113 | ||
113 | this.setState({ | 114 | this.setState({ |
114 | hibernationTimer, | 115 | hibernationTimer, |