auto update dependencies available on npm
This commit is contained in:
parent
e8c7dfa6a7
commit
965cb29699
23 changed files with 20036 additions and 114 deletions
|
|
@ -379,9 +379,9 @@ const index = (() => {
|
|||
}
|
||||
|
||||
if (navigation.isPlaying()) {
|
||||
_NoSleep.enable();
|
||||
noSleepEnable();
|
||||
} else {
|
||||
_NoSleep.disable();
|
||||
noSleepDisable();
|
||||
}
|
||||
|
||||
UpdateFullScreenNavigate();
|
||||
|
|
@ -683,13 +683,13 @@ const index = (() => {
|
|||
localStorage.setItem('TwcPlay', navigation.isPlaying());
|
||||
|
||||
if (navigation.isPlaying()) {
|
||||
_NoSleep.enable();
|
||||
noSleepEnable();
|
||||
$('img[src=\'images/nav/ic_play_arrow_white_24dp_1x.png\']').attr('title', 'Pause');
|
||||
$('img[src=\'images/nav/ic_play_arrow_white_24dp_1x.png\']').attr('src', 'images/nav/ic_pause_white_24dp_1x.png');
|
||||
$('img[src=\'images/nav/ic_play_arrow_white_24dp_2x.png\']').attr('title', 'Pause');
|
||||
$('img[src=\'images/nav/ic_play_arrow_white_24dp_2x.png\']').attr('src', 'images/nav/ic_pause_white_24dp_2x.png');
|
||||
} else {
|
||||
_NoSleep.disable();
|
||||
noSleepDisable();
|
||||
|
||||
$('img[src=\'images/nav/ic_pause_white_24dp_1x.png\']').attr('title', 'Play');
|
||||
$('img[src=\'images/nav/ic_pause_white_24dp_1x.png\']').attr('src', 'images/nav/ic_play_arrow_white_24dp_1x.png');
|
||||
|
|
@ -812,6 +812,18 @@ const index = (() => {
|
|||
postMessage('assignScrollText', ScrollText);
|
||||
};
|
||||
|
||||
// track state of nosleep locally to avoid a null case error when nosleep.disable is called without first calling .enable
|
||||
let wakeLock = false;
|
||||
const noSleepEnable = () => {
|
||||
_NoSleep.enable();
|
||||
wakeLock = true;
|
||||
};
|
||||
const noSleepDisable = () => {
|
||||
if (!wakeLock) return;
|
||||
_NoSleep.disable();
|
||||
wakeLock = false;
|
||||
};
|
||||
|
||||
return {
|
||||
init,
|
||||
message,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue