This commit is contained in:
ostertun
2020-10-05 17:35:10 +02:00
parent 203c2534eb
commit fcf9dc9a20
3 changed files with 362 additions and 359 deletions

View File

@@ -483,6 +483,7 @@ function sync() {
if (!canUseLocalDB) return false;
if (syncInProgress > 0) return false;
return new Promise(function(resolve) {
var now = Math.floor(Date.now() / 1000);
db.transaction('update_times').objectStore('update_times').getAll().onsuccess = function (event) {
@@ -513,6 +514,7 @@ function sync() {
}
removeSyncInfoToPreloader();
runPageScript();
resolve();
}
}, 100);
@@ -910,6 +912,7 @@ function sync() {
}
});
};
});
}
function checkSync() {

View File

@@ -18,13 +18,13 @@ async function planningSwitchChanged() {
},
error: function (xhr, status, error) {
if (xhr.status == 401) {
console.log('authentification failed');
log('authentification failed');
toastError('Authentifizierung fehlgeschlagen. Versuche es erneut.');
} else if (xhr.status == 0) {
toastError('Du bist momentan offline.<br>Stelle eine Internetverbindung her, um den Status zu &auml;ndern');
} else {
console.log('Login: unbekannter Fehler', status, error);
console.log(xhr);
log('Login: unbekannter Fehler', status, error);
log(xhr);
toastError('Ein unbekannter Fehler ist aufgetreten. Bitte versuche es noch einmal', 5000);
}
$('#menu-status').hideMenu();

View File

@@ -17,13 +17,13 @@ async function planningSwitchChanged() {
},
error: function (xhr, status, error) {
if (xhr.status == 401) {
console.log('authentification failed');
log('authentification failed');
toastError('Authentifizierung fehlgeschlagen. Versuche es erneut.');
} else if (xhr.status == 0) {
toastError('Du bist momentan offline.<br>Stelle eine Internetverbindung her, um die &Auml;nderungen zu speichern');
} else {
console.log('planning_add: unbekannter Fehler', status, error);
console.log(xhr);
log('planning_add: unbekannter Fehler', status, error);
log(xhr);
toastError('Ein unbekannter Fehler ist aufgetreten. Bitte versuche es noch einmal', 5000);
}
$('#menu-edit').hideMenu();
@@ -46,13 +46,13 @@ async function planningSwitchChanged() {
},
error: function (xhr, status, error) {
if (xhr.status == 401) {
console.log('authentification failed');
log('authentification failed');
toastError('Authentifizierung fehlgeschlagen. Versuche es erneut.');
} else if (xhr.status == 0) {
toastError('Du bist momentan offline.<br>Stelle eine Internetverbindung her, um die &Auml;nderungen zu speichern');
} else {
console.log('planning_remove: unbekannter Fehler', status, error);
console.log(xhr);
log('planning_remove: unbekannter Fehler', status, error);
log(xhr);
toastError('Ein unbekannter Fehler ist aufgetreten. Bitte versuche es noch einmal', 5000);
}
$('#menu-edit').hideMenu();
@@ -90,13 +90,13 @@ async function sailorSelected(sid) {
},
error: function (xhr, status, error) {
if (xhr.status == 401) {
console.log('authentification failed');
log('authentification failed');
toastError('Authentifizierung fehlgeschlagen. Versuche es erneut.');
} else if (xhr.status == 0) {
toastError('Du bist momentan offline.<br>Stelle eine Internetverbindung her, um die &Auml;nderungen zu speichern');
} else {
console.log(action + ': unbekannter Fehler', status, error);
console.log(xhr);
log(action + ': unbekannter Fehler', status, error);
log(xhr);
toastError('Ein unbekannter Fehler ist aufgetreten. Bitte versuche es noch einmal', 5000);
}
hideLoader();
@@ -167,13 +167,13 @@ async function planningChangeCrew(sid = null) {
},
error: function (xhr, status, error) {
if (xhr.status == 401) {
console.log('authentification failed');
log('authentification failed');
toastError('Authentifizierung fehlgeschlagen. Versuche es erneut.');
} else if (xhr.status == 0) {
toastError('Du bist momentan offline.<br>Stelle eine Internetverbindung her, um die &Auml;nderungen zu speichern');
} else {
console.log('planning_remove_crew: unbekannter Fehler', status, error);
console.log(xhr);
log('planning_remove_crew: unbekannter Fehler', status, error);
log(xhr);
toastError('Ein unbekannter Fehler ist aufgetreten. Bitte versuche es noch einmal', 5000);
}
$('#menu-edit').hideMenu();