v2 transactions
This commit is contained in:
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
/*Generated on:Wed Dec 19 2018 17:03:17 GMT+0100 (CET)*/
|
/*Generated on:Wed Dec 19 2018 17:06:29 GMT+0100 (CET)*/
|
||||||
var AutomaticDispose_Branch = "master";
|
var AutomaticDispose_Branch = "master";
|
||||||
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
|
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
|
||||||
var da_lss_adis_time = new Date().getTime();
|
var da_lss_adis_time = new Date().getTime();
|
||||||
|
|||||||
Vendored
+49
-11
@@ -1,4 +1,4 @@
|
|||||||
/*Generated on:Wed Dec 19 2018 17:03:17 GMT+0100 (CET)*/
|
/*Generated on:Wed Dec 19 2018 17:06:29 GMT+0100 (CET)*/
|
||||||
/*
|
/*
|
||||||
* Dexie.js - a minimalistic wrapper for IndexedDB
|
* Dexie.js - a minimalistic wrapper for IndexedDB
|
||||||
* ===============================================
|
* ===============================================
|
||||||
@@ -17201,14 +17201,26 @@ class AutomaticDispose {
|
|||||||
// - Sprechwunsch Queue
|
// - Sprechwunsch Queue
|
||||||
// -
|
// -
|
||||||
RemovePoliceSprechwunschFromQueue(WunschID) {
|
RemovePoliceSprechwunschFromQueue(WunschID) {
|
||||||
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunschPolice.where({
|
return this.ADisDB.ADisSprechwunschPolice.where({
|
||||||
missionID: WunschID
|
missionID: WunschID
|
||||||
}).delete();
|
}).delete();
|
||||||
|
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
RemoveRescueSprechwunschFromQueue(WunschID) {
|
RemoveRescueSprechwunschFromQueue(WunschID) {
|
||||||
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunsch.where({
|
return this.ADisDB.ADisSprechwunsch.where({
|
||||||
vehicleID: WunschID
|
vehicleID: WunschID
|
||||||
}).delete();
|
}).delete();
|
||||||
|
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||||
@@ -17219,6 +17231,7 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
CollectRescueSprechwuensche() {
|
CollectRescueSprechwuensche() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
new Promise(async (resolve, reject) => {
|
new Promise(async (resolve, reject) => {
|
||||||
await self.ADisDB.ADisSprechwunsch.where({
|
await self.ADisDB.ADisSprechwunsch.where({
|
||||||
done: 'false'
|
done: 'false'
|
||||||
@@ -17237,11 +17250,15 @@ class AutomaticDispose {
|
|||||||
self.AddRescueSprechwunschToQueue(VehicleID);
|
self.AddRescueSprechwunschToQueue(VehicleID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenNextRescueSprechwunsch() {
|
OpenNextRescueSprechwunsch() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
this.ADSettings().then((setting) => {
|
this.ADSettings().then((setting) => {
|
||||||
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
||||||
return self.ADisDB.ADisSprechwunsch.where({
|
return self.ADisDB.ADisSprechwunsch.where({
|
||||||
@@ -17267,22 +17284,33 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
AddRescueSprechwunschToQueue(WunschID) {
|
AddRescueSprechwunschToQueue(WunschID) {
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunsch.put({
|
return this.ADisDB.ADisSprechwunsch.put({
|
||||||
vehicleID: WunschID,
|
vehicleID: WunschID,
|
||||||
done: 'false'
|
done: 'false'
|
||||||
}).catch((err) => {})
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UpdateRescueSprechwunschToDone(WunschID) {
|
UpdateRescueSprechwunschToDone(WunschID) {
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunsch.put({
|
return this.ADisDB.ADisSprechwunsch.put({
|
||||||
vehicleID: WunschID,
|
vehicleID: WunschID,
|
||||||
done: 'true'
|
done: 'true'
|
||||||
}).catch((err) => {})
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -17393,6 +17421,7 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
CollectPoliceSprechwuensche() {
|
CollectPoliceSprechwuensche() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||||
new Promise(async (resolve, reject) => {
|
new Promise(async (resolve, reject) => {
|
||||||
await self.ADisDB.ADisSprechwunschPolice.where({
|
await self.ADisDB.ADisSprechwunschPolice.where({
|
||||||
done: 'false'
|
done: 'false'
|
||||||
@@ -17427,7 +17456,10 @@ class AutomaticDispose {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenNextPoliceSprechwunsch() {
|
OpenNextPoliceSprechwunsch() {
|
||||||
@@ -17459,7 +17491,9 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch((err) => {})
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
AddPoliceSprechwunschToQueue(WunschID) {
|
AddPoliceSprechwunschToQueue(WunschID) {
|
||||||
@@ -17469,7 +17503,9 @@ class AutomaticDispose {
|
|||||||
missionID: WunschID,
|
missionID: WunschID,
|
||||||
done: 'false'
|
done: 'false'
|
||||||
})
|
})
|
||||||
}).catch((err) => {})
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePoliceSprechwunschToDone(WunschID) {
|
UpdatePoliceSprechwunschToDone(WunschID) {
|
||||||
@@ -17479,7 +17515,9 @@ class AutomaticDispose {
|
|||||||
missionID: WunschID,
|
missionID: WunschID,
|
||||||
done: 'true'
|
done: 'true'
|
||||||
})
|
})
|
||||||
}).catch((err) => {})
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -18139,7 +18177,6 @@ class AutomaticDispose {
|
|||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], async () => {
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], async () => {
|
||||||
return self.ADSettings().then(async () => {
|
return self.ADSettings().then(async () => {
|
||||||
return self.ADisDB.ADisMissions.toCollection()
|
return self.ADisDB.ADisMissions.toCollection()
|
||||||
})
|
|
||||||
}).then((Missions) => {
|
}).then((Missions) => {
|
||||||
if (typeof Missions !== "undefined") {
|
if (typeof Missions !== "undefined") {
|
||||||
return Missions.count((count) => {
|
return Missions.count((count) => {
|
||||||
@@ -18167,6 +18204,7 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
});;
|
});;
|
||||||
@@ -18449,7 +18487,6 @@ class AutomaticDispose {
|
|||||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||||
}).limit(1)
|
}).limit(1)
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}).then((Wunsch) => {
|
}).then((Wunsch) => {
|
||||||
if (Wunsch !== undefined) {
|
if (Wunsch !== undefined) {
|
||||||
return Wunsch.count(function (count) {
|
return Wunsch.count(function (count) {
|
||||||
@@ -18469,6 +18506,7 @@ class AutomaticDispose {
|
|||||||
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
|
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
})
|
})
|
||||||
|
|||||||
+48
-10
@@ -194,14 +194,26 @@ class AutomaticDispose {
|
|||||||
// - Sprechwunsch Queue
|
// - Sprechwunsch Queue
|
||||||
// -
|
// -
|
||||||
RemovePoliceSprechwunschFromQueue(WunschID) {
|
RemovePoliceSprechwunschFromQueue(WunschID) {
|
||||||
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunschPolice.where({
|
return this.ADisDB.ADisSprechwunschPolice.where({
|
||||||
missionID: WunschID
|
missionID: WunschID
|
||||||
}).delete();
|
}).delete();
|
||||||
|
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
RemoveRescueSprechwunschFromQueue(WunschID) {
|
RemoveRescueSprechwunschFromQueue(WunschID) {
|
||||||
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunsch.where({
|
return this.ADisDB.ADisSprechwunsch.where({
|
||||||
vehicleID: WunschID
|
vehicleID: WunschID
|
||||||
}).delete();
|
}).delete();
|
||||||
|
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||||
@@ -212,6 +224,7 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
CollectRescueSprechwuensche() {
|
CollectRescueSprechwuensche() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
new Promise(async (resolve, reject) => {
|
new Promise(async (resolve, reject) => {
|
||||||
await self.ADisDB.ADisSprechwunsch.where({
|
await self.ADisDB.ADisSprechwunsch.where({
|
||||||
done: 'false'
|
done: 'false'
|
||||||
@@ -230,11 +243,15 @@ class AutomaticDispose {
|
|||||||
self.AddRescueSprechwunschToQueue(VehicleID);
|
self.AddRescueSprechwunschToQueue(VehicleID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenNextRescueSprechwunsch() {
|
OpenNextRescueSprechwunsch() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
this.ADSettings().then((setting) => {
|
this.ADSettings().then((setting) => {
|
||||||
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
||||||
return self.ADisDB.ADisSprechwunsch.where({
|
return self.ADisDB.ADisSprechwunsch.where({
|
||||||
@@ -260,22 +277,33 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
AddRescueSprechwunschToQueue(WunschID) {
|
AddRescueSprechwunschToQueue(WunschID) {
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunsch.put({
|
return this.ADisDB.ADisSprechwunsch.put({
|
||||||
vehicleID: WunschID,
|
vehicleID: WunschID,
|
||||||
done: 'false'
|
done: 'false'
|
||||||
}).catch((err) => {})
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UpdateRescueSprechwunschToDone(WunschID) {
|
UpdateRescueSprechwunschToDone(WunschID) {
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
|
||||||
return this.ADisDB.ADisSprechwunsch.put({
|
return this.ADisDB.ADisSprechwunsch.put({
|
||||||
vehicleID: WunschID,
|
vehicleID: WunschID,
|
||||||
done: 'true'
|
done: 'true'
|
||||||
}).catch((err) => {})
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -386,6 +414,7 @@ class AutomaticDispose {
|
|||||||
|
|
||||||
CollectPoliceSprechwuensche() {
|
CollectPoliceSprechwuensche() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||||
new Promise(async (resolve, reject) => {
|
new Promise(async (resolve, reject) => {
|
||||||
await self.ADisDB.ADisSprechwunschPolice.where({
|
await self.ADisDB.ADisSprechwunschPolice.where({
|
||||||
done: 'false'
|
done: 'false'
|
||||||
@@ -420,7 +449,10 @@ class AutomaticDispose {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
})
|
||||||
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenNextPoliceSprechwunsch() {
|
OpenNextPoliceSprechwunsch() {
|
||||||
@@ -452,7 +484,9 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch((err) => {})
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
AddPoliceSprechwunschToQueue(WunschID) {
|
AddPoliceSprechwunschToQueue(WunschID) {
|
||||||
@@ -462,7 +496,9 @@ class AutomaticDispose {
|
|||||||
missionID: WunschID,
|
missionID: WunschID,
|
||||||
done: 'false'
|
done: 'false'
|
||||||
})
|
})
|
||||||
}).catch((err) => {})
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePoliceSprechwunschToDone(WunschID) {
|
UpdatePoliceSprechwunschToDone(WunschID) {
|
||||||
@@ -472,7 +508,9 @@ class AutomaticDispose {
|
|||||||
missionID: WunschID,
|
missionID: WunschID,
|
||||||
done: 'true'
|
done: 'true'
|
||||||
})
|
})
|
||||||
}).catch((err) => {})
|
}).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -898,7 +936,6 @@ class AutomaticDispose {
|
|||||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], async () => {
|
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions, self.ADisDB.ADisAvailabelMissions], async () => {
|
||||||
return self.ADSettings().then(async () => {
|
return self.ADSettings().then(async () => {
|
||||||
return self.ADisDB.ADisMissions.toCollection()
|
return self.ADisDB.ADisMissions.toCollection()
|
||||||
})
|
|
||||||
}).then((Missions) => {
|
}).then((Missions) => {
|
||||||
if (typeof Missions !== "undefined") {
|
if (typeof Missions !== "undefined") {
|
||||||
return Missions.count((count) => {
|
return Missions.count((count) => {
|
||||||
@@ -926,6 +963,7 @@ class AutomaticDispose {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
});;
|
});;
|
||||||
@@ -1208,7 +1246,6 @@ class AutomaticDispose {
|
|||||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||||
}).limit(1)
|
}).limit(1)
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}).then((Wunsch) => {
|
}).then((Wunsch) => {
|
||||||
if (Wunsch !== undefined) {
|
if (Wunsch !== undefined) {
|
||||||
return Wunsch.count(function (count) {
|
return Wunsch.count(function (count) {
|
||||||
@@ -1228,6 +1265,7 @@ class AutomaticDispose {
|
|||||||
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
|
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user