Skip to content
Snippets Groups Projects
Commit 15a20d51 authored by jojohoch's avatar jojohoch
Browse files

[player] Handle promise when enabling noSleep instance

parent ada39d27
No related branches found
No related tags found
No related merge requests found
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import NoSleep from 'nosleep.js'; import NoSleep from 'nosleep.js';
import { LogService } from 'player/modules/logging/services/log.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
...@@ -16,7 +17,8 @@ export class DeviceService { ...@@ -16,7 +17,8 @@ export class DeviceService {
dontSleep(): void { dontSleep(): void {
if (this.isTouch && (!this.noSleep || !this.noSleep.isEnabled )) { if (this.isTouch && (!this.noSleep || !this.noSleep.isEnabled )) {
this.noSleep = new NoSleep(); this.noSleep = new NoSleep();
this.noSleep.enable(); this.noSleep.enable().then(() => {},
() => LogService.error('player: enabling noSleep instance failed'));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment