mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix windows restart
This commit is contained in:
parent
4ef47844d8
commit
257a7d2879
18 changed files with 221 additions and 141 deletions
52
dashboard-ui/cordova/ios/backgroundfetch.js
vendored
Normal file
52
dashboard-ui/cordova/ios/backgroundfetch.js
vendored
Normal file
|
@ -0,0 +1,52 @@
|
|||
(function () {
|
||||
|
||||
function onDeviceReady() {
|
||||
|
||||
var fetcher = window.BackgroundFetch;
|
||||
|
||||
fetcher.configure(onBackgroundFetch, onBackgroundFetchFailed, {
|
||||
stopOnTerminate: false // <-- false is default
|
||||
});
|
||||
}
|
||||
|
||||
function onSyncFinish() {
|
||||
|
||||
Logger.log('BackgroundFetch completed');
|
||||
|
||||
var fetcher = window.BackgroundFetch;
|
||||
fetcher.finish(); // <-- N.B. You MUST called #finish so that native-side can signal completion of the background-thread to the os.
|
||||
}
|
||||
|
||||
function onSyncFail() {
|
||||
|
||||
Logger.log('BackgroundFetch completed - sync failed');
|
||||
|
||||
var fetcher = window.BackgroundFetch;
|
||||
fetcher.finish(); // <-- N.B. You MUST called #finish so that native-side can signal completion of the background-thread to the os.
|
||||
}
|
||||
|
||||
function onBackgroundFetch() {
|
||||
|
||||
Logger.log('BackgroundFetch initiated');
|
||||
|
||||
require(['localsync'], function () {
|
||||
|
||||
if (LocalSync.getSyncStatus() == 'Syncing') {
|
||||
onSyncFinish();
|
||||
return;
|
||||
}
|
||||
|
||||
var syncOptions = {
|
||||
uploadPhotos: false
|
||||
};
|
||||
|
||||
LocalSync.sync(syncOptions).done(onSyncFinish).fail(onSyncFail);
|
||||
});
|
||||
}
|
||||
|
||||
function onBackgroundFetchFailed() {
|
||||
Logger.log('- BackgroundFetch failed');
|
||||
}
|
||||
|
||||
onDeviceReady();
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue