diff --git a/dist/autoloader.js b/dist/autoloader.js index ec6cb21..a8c4155 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Sun Dec 02 2018 10:49:01 GMT+0100 (CET)*/ +/*Generated on:Sun Dec 02 2018 10:51:08 GMT+0100 (CET)*/ var AutomaticDispose_Branch = "master"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var da_lss_adis_time = new Date().getTime(); diff --git a/dist/autoloaderV2.js b/dist/autoloaderV2.js index 30883f2..a532df8 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Sun Dec 02 2018 10:49:01 GMT+0100 (CET)*/ +/*Generated on:Sun Dec 02 2018 10:51:08 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -18192,12 +18192,10 @@ class AutomaticDispose { RemoveMissionsFromQueue(MissionID) { const self = this; - return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { - return self.ADisDB.ADisMissions.where({ - missionID: MissionID - }).delete().catch((err) => { - console.error(err) - }) + return self.ADisDB.ADisMissions.where({ + missionID: MissionID + }).delete().catch((err) => { + console.error(err) }) } @@ -18290,33 +18288,35 @@ class AutomaticDispose { console.log("Window", window.name); console.log("self.MyRunner", self.MyRunner); console.log("self.MyRunnerSettings", self.MyRunnerSettings); - self.ADSettings().then((setting) => { - if (setting[self.MyRunnerSettings] === 'true') { + return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { + self.ADSettings().then((setting) => { + if (setting[self.MyRunnerSettings] === 'true') { - let where = { - missionID: self.MissionID, - runner: self.MyRunner, - done: 'false' - } - console.log(where); - return self.ADisDB.ADisMissions.where(where).limit(1) - } - }).then((Wunsch) => { - if (Wunsch !== undefined) { - return Wunsch.count(function (count) { - if (count > 0) { - return Wunsch.each((mywunsch) => { - return self.MainHandler() - }); - } else { - self.RemoveMissionsFromQueue(self.MissionID) - return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + let where = { + missionID: self.MissionID, + runner: self.MyRunner, + done: 'false' } - }); - } else { - self.RemoveMissionsFromQueue(self.MissionID) - return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); - } + console.log(where); + return self.ADisDB.ADisMissions.where(where).limit(1) + } + }).then((Wunsch) => { + if (Wunsch !== undefined) { + return Wunsch.count(function (count) { + if (count > 0) { + return Wunsch.each((mywunsch) => { + return self.MainHandler() + }); + } else { + self.RemoveMissionsFromQueue(self.MissionID) + return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + } + }); + } else { + self.RemoveMissionsFromQueue(self.MissionID) + return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + } + }) }) }, 1500); } diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index b6dcbb9..7971d2e 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -1022,12 +1022,10 @@ class AutomaticDispose { RemoveMissionsFromQueue(MissionID) { const self = this; - return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { - return self.ADisDB.ADisMissions.where({ - missionID: MissionID - }).delete().catch((err) => { - console.error(err) - }) + return self.ADisDB.ADisMissions.where({ + missionID: MissionID + }).delete().catch((err) => { + console.error(err) }) } @@ -1120,33 +1118,35 @@ class AutomaticDispose { console.log("Window", window.name); console.log("self.MyRunner", self.MyRunner); console.log("self.MyRunnerSettings", self.MyRunnerSettings); - self.ADSettings().then((setting) => { - if (setting[self.MyRunnerSettings] === 'true') { + return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => { + self.ADSettings().then((setting) => { + if (setting[self.MyRunnerSettings] === 'true') { - let where = { - missionID: self.MissionID, - runner: self.MyRunner, - done: 'false' - } - console.log(where); - return self.ADisDB.ADisMissions.where(where).limit(1) - } - }).then((Wunsch) => { - if (Wunsch !== undefined) { - return Wunsch.count(function (count) { - if (count > 0) { - return Wunsch.each((mywunsch) => { - return self.MainHandler() - }); - } else { - self.RemoveMissionsFromQueue(self.MissionID) - return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + let where = { + missionID: self.MissionID, + runner: self.MyRunner, + done: 'false' } - }); - } else { - self.RemoveMissionsFromQueue(self.MissionID) - return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); - } + console.log(where); + return self.ADisDB.ADisMissions.where(where).limit(1) + } + }).then((Wunsch) => { + if (Wunsch !== undefined) { + return Wunsch.count(function (count) { + if (count > 0) { + return Wunsch.each((mywunsch) => { + return self.MainHandler() + }); + } else { + self.RemoveMissionsFromQueue(self.MissionID) + return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + } + }); + } else { + self.RemoveMissionsFromQueue(self.MissionID) + return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); + } + }) }) }, 1500); }