Use store to get nosleep setting in map view

This commit is contained in:
Lucas Verney 2018-07-17 16:22:18 +02:00
parent e9b4f41b1e
commit 8921833619

View File

@ -155,14 +155,7 @@ export default {
} }
}, },
setNoSleep() { setNoSleep() {
let preventSuspend = localStorage.getItem('preventSuspend'); if (this.$store.state.settings.preventSuspend) {
if (preventSuspend) {
preventSuspend = JSON.parse(preventSuspend);
} else {
preventSuspend = true;
}
if (preventSuspend) {
this.noSleep = new NoSleep(); this.noSleep = new NoSleep();
this.noSleep.enable(); this.noSleep.enable();
} }