From 1817977520c9fa2b678f65dbb42c723d1aa3b9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Wed, 19 Dec 2018 17:34:08 +0100 Subject: [PATCH] v2 transact --- dist/autoloader.js | 2 +- dist/autoloaderV2.js | 22 +++++++++++++--------- src/autoloaderV2.js | 20 ++++++++++++-------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/dist/autoloader.js b/dist/autoloader.js index 96ac596..f10cf3b 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Dec 19 2018 17:28:31 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 17:34: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 f6f7796..5d93e2b 100644 --- a/dist/autoloaderV2.js +++ b/dist/autoloaderV2.js @@ -1,4 +1,4 @@ -/*Generated on:Wed Dec 19 2018 17:28:31 GMT+0100 (CET)*/ +/*Generated on:Wed Dec 19 2018 17:34:08 GMT+0100 (CET)*/ /* * Dexie.js - a minimalistic wrapper for IndexedDB * =============================================== @@ -4479,7 +4479,7 @@ class AutomaticDispose { // Variablen get ADisSettings() { - let self =this + let self = this return { url: "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/", branch: "master", @@ -17277,9 +17277,11 @@ class AutomaticDispose { self.RescueVehicleFrameWatchDog = setTimeout(async function () { let self = this; - self.RemoveRescueSprechwunschFromQueue(VehicleID).then((deleteCount) => { - $("#adis-sprechwunsch-rescue-frame").attr("src", ""); - $("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", "empty"); + return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { + self.RemoveRescueSprechwunschFromQueue(VehicleID).then((deleteCount) => { + $("#adis-sprechwunsch-rescue-frame").attr("src", ""); + $("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", "empty"); + }); }); }.bind(self), 1500); } @@ -17486,9 +17488,11 @@ class AutomaticDispose { self.PoliceVehicleFrameWatchDog = setTimeout(async function (MissionID) { let self = this; - await self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => { - $("#adis-sprechwunsch-police-frame").attr("src", ""); - $("#adis-sprechwunsch-police-frame").attr("mission_id", "empty"); + return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { + await self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => { + $("#adis-sprechwunsch-police-frame").attr("src", ""); + $("#adis-sprechwunsch-police-frame").attr("mission_id", "empty"); + }); }); }.bind(self), 1500, MissionID); } @@ -18199,7 +18203,7 @@ class AutomaticDispose { }); } }).then(() => { - + if (typeof MissionID != 'undefined') { return self.AddMission(MissionID, Runner); } else { diff --git a/src/autoloaderV2.js b/src/autoloaderV2.js index 963013d..d5da8a4 100644 --- a/src/autoloaderV2.js +++ b/src/autoloaderV2.js @@ -4,7 +4,7 @@ class AutomaticDispose { // Variablen get ADisSettings() { - let self =this + let self = this return { url: "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/", branch: "master", @@ -270,9 +270,11 @@ class AutomaticDispose { self.RescueVehicleFrameWatchDog = setTimeout(async function () { let self = this; - self.RemoveRescueSprechwunschFromQueue(VehicleID).then((deleteCount) => { - $("#adis-sprechwunsch-rescue-frame").attr("src", ""); - $("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", "empty"); + return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { + self.RemoveRescueSprechwunschFromQueue(VehicleID).then((deleteCount) => { + $("#adis-sprechwunsch-rescue-frame").attr("src", ""); + $("#adis-sprechwunsch-rescue-frame").attr("vehicle_id", "empty"); + }); }); }.bind(self), 1500); } @@ -479,9 +481,11 @@ class AutomaticDispose { self.PoliceVehicleFrameWatchDog = setTimeout(async function (MissionID) { let self = this; - await self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => { - $("#adis-sprechwunsch-police-frame").attr("src", ""); - $("#adis-sprechwunsch-police-frame").attr("mission_id", "empty"); + return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { + await self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => { + $("#adis-sprechwunsch-police-frame").attr("src", ""); + $("#adis-sprechwunsch-police-frame").attr("mission_id", "empty"); + }); }); }.bind(self), 1500, MissionID); } @@ -958,7 +962,7 @@ class AutomaticDispose { }); } }).then(() => { - + if (typeof MissionID != 'undefined') { return self.AddMission(MissionID, Runner); } else {