v2 update check why missions not send

This commit is contained in:
2018-12-18 01:35:33 +01:00
parent a1b3e1a310
commit a3f604579d
3 changed files with 28 additions and 26 deletions

View File

@@ -1162,12 +1162,12 @@ class AutomaticDispose {
// console.log("self.MyRunner", self.MyRunner);
// console.log("self.MyRunnerSettings", self.MyRunnerSettings);
if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
console.log("DONE: " + self.MissionID);
return self.RemoveMissionsFromQueue(self.MissionID).then(() => {
return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
})
} else {
// if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
// console.log("DONE: ", self.MissionID);
// return self.RemoveMissionsFromQueue(self.MissionID).then(() => {
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
// })
// } else {
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
self.ADSettings().then((setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
@@ -1187,10 +1187,11 @@ class AutomaticDispose {
return Wunsch.count(function (count) {
if (count > 0) {
return Wunsch.each((mywunsch) => {
console.table(mywunsch);
return self.MainHandler()
});
} else {
return self.RemoveMissionsFromQueue(self.MissionID).then(() => {
return self.UpdateMissionsToDone(self.MissionID).then(() => {
return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
})
}
@@ -1202,7 +1203,7 @@ class AutomaticDispose {
}
})
})
}
// }
}, 100);
}
@@ -1211,13 +1212,13 @@ class AutomaticDispose {
const self = this;
if (self.includesString($('#iframe-inside-container > div.missionNotFound > div.missionNotFoundText').text(), 'Der Einsatz wurde erfolgreich abgeschlossen.')) {
console.log("DONE!");
console.log("DONE: " + self.MissionID);
console.log("DONE: ", self.MissionID);
return self.RemoveMissionsFromQueue(self.MissionID).then(() => {
return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
})
} else if (self.includesString($('#iframe-inside-container > div.alert.fade.in.alert-success').text(), "wurde erfolgreich informiert") /*|| $('#vehicle_show_table_all input[type="checkbox"]:checked').length > 0*/ ) {
console.log("SEND");
console.log("SEND: " + self.MissionID);
console.log("SEND: ", self.MissionID);
return self.UpdateMissionsToDone(self.MissionID).then(() => {
return tellParent(`console.log('handler:2000:update:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // update Mission here as updated or full
});
@@ -1412,7 +1413,7 @@ class AutomaticDispose {
setTimeout(() => {
self.UpdateMissionsToDone(self.MissionID).then(() => {
tellParent(`setTimeout(function(){console.log('ok:${window.name}:${self.MissionID}');},500);`);
tellParent(`console.log('ok:${window.name}:${self.MissionID}');`);
window.$('#mission_alarm_btn').click();
});
}, 250);
@@ -1430,7 +1431,7 @@ class AutomaticDispose {
if (mutation.attributeName === "style") {
setTimeout(function () {
alarming(self)
}, 750);
}, 500);
}
});
});