v2 transactions
This commit is contained in:
2
dist/autoloader.js
vendored
2
dist/autoloader.js
vendored
@@ -1,4 +1,4 @@
|
||||
/*Generated on:Wed Dec 19 2018 16:49:46 GMT+0100 (CET)*/
|
||||
/*Generated on:Wed Dec 19 2018 17:03:17 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();
|
||||
|
||||
82
dist/autoloaderV2.js
vendored
82
dist/autoloaderV2.js
vendored
@@ -1,4 +1,4 @@
|
||||
/*Generated on:Wed Dec 19 2018 16:49:46 GMT+0100 (CET)*/
|
||||
/*Generated on:Wed Dec 19 2018 17:03:17 GMT+0100 (CET)*/
|
||||
/*
|
||||
* Dexie.js - a minimalistic wrapper for IndexedDB
|
||||
* ===============================================
|
||||
@@ -17432,45 +17432,53 @@ class AutomaticDispose {
|
||||
|
||||
OpenNextPoliceSprechwunsch() {
|
||||
let self = this;
|
||||
this.ADSettings().then((setting) => {
|
||||
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
||||
return self.ADisDB.ADisSprechwunschPolice.where({
|
||||
done: 'false'
|
||||
}).limit(1)
|
||||
}
|
||||
}).then((Wunsch) => {
|
||||
if (Wunsch !== undefined) {
|
||||
Wunsch.each((myWunsch) => {
|
||||
let MissionID = myWunsch.missionID;
|
||||
self.UpdatePoliceSprechwunschToDone(MissionID).then(() => {
|
||||
if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID);
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||
this.ADSettings().then((setting) => {
|
||||
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
||||
return self.ADisDB.ADisSprechwunschPolice.where({
|
||||
done: 'false'
|
||||
}).limit(1)
|
||||
}
|
||||
}).then((Wunsch) => {
|
||||
if (Wunsch !== undefined) {
|
||||
Wunsch.each((myWunsch) => {
|
||||
let MissionID = myWunsch.missionID;
|
||||
self.UpdatePoliceSprechwunschToDone(MissionID).then(() => {
|
||||
if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID);
|
||||
|
||||
self.PoliceVehicleFrameWatchDog = setTimeout(async (MissionID) => {
|
||||
self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "");
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", "empty");
|
||||
});
|
||||
}, 1500, MissionID);
|
||||
}
|
||||
self.PoliceVehicleFrameWatchDog = setTimeout(async (MissionID) => {
|
||||
self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "");
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", "empty");
|
||||
});
|
||||
}, 1500, MissionID);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}).catch((err) => {})
|
||||
}
|
||||
|
||||
AddPoliceSprechwunschToQueue(WunschID) {
|
||||
return this.ADisDB.ADisSprechwunschPolice.put({
|
||||
missionID: WunschID,
|
||||
done: 'false'
|
||||
let self = this;
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||
return this.ADisDB.ADisSprechwunschPolice.put({
|
||||
missionID: WunschID,
|
||||
done: 'false'
|
||||
})
|
||||
}).catch((err) => {})
|
||||
}
|
||||
|
||||
UpdatePoliceSprechwunschToDone(WunschID) {
|
||||
return this.ADisDB.ADisSprechwunschPolice.add({
|
||||
missionID: WunschID,
|
||||
done: 'true'
|
||||
let self = this;
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||
return self.ADisDB.ADisSprechwunschPolice.add({
|
||||
missionID: WunschID,
|
||||
done: 'true'
|
||||
})
|
||||
}).catch((err) => {})
|
||||
}
|
||||
|
||||
@@ -18080,11 +18088,13 @@ class AutomaticDispose {
|
||||
}
|
||||
|
||||
AddAvailableMissions(Mission) {
|
||||
return this.ADisDB.ADisAvailabelMissions.put({
|
||||
missionID: Mission.id,
|
||||
type: Mission.type,
|
||||
name: Mission.name,
|
||||
jsondata: Mission
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisAvailabelMissions], async () => {
|
||||
return this.ADisDB.ADisAvailabelMissions.put({
|
||||
missionID: Mission.id,
|
||||
type: Mission.type,
|
||||
name: Mission.name,
|
||||
jsondata: Mission
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
|
||||
@@ -425,45 +425,53 @@ class AutomaticDispose {
|
||||
|
||||
OpenNextPoliceSprechwunsch() {
|
||||
let self = this;
|
||||
this.ADSettings().then((setting) => {
|
||||
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
||||
return self.ADisDB.ADisSprechwunschPolice.where({
|
||||
done: 'false'
|
||||
}).limit(1)
|
||||
}
|
||||
}).then((Wunsch) => {
|
||||
if (Wunsch !== undefined) {
|
||||
Wunsch.each((myWunsch) => {
|
||||
let MissionID = myWunsch.missionID;
|
||||
self.UpdatePoliceSprechwunschToDone(MissionID).then(() => {
|
||||
if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID);
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||
this.ADSettings().then((setting) => {
|
||||
if (setting['Sprechwunsch-Automatic'] == 'true') {
|
||||
return self.ADisDB.ADisSprechwunschPolice.where({
|
||||
done: 'false'
|
||||
}).limit(1)
|
||||
}
|
||||
}).then((Wunsch) => {
|
||||
if (Wunsch !== undefined) {
|
||||
Wunsch.each((myWunsch) => {
|
||||
let MissionID = myWunsch.missionID;
|
||||
self.UpdatePoliceSprechwunschToDone(MissionID).then(() => {
|
||||
if ($("#adis-sprechwunsch-police-frame").attr("mission_id") == "empty") {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "https://www.leitstellenspiel.de/missions/" + MissionID);
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", MissionID);
|
||||
|
||||
self.PoliceVehicleFrameWatchDog = setTimeout(async (MissionID) => {
|
||||
self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "");
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", "empty");
|
||||
});
|
||||
}, 1500, MissionID);
|
||||
}
|
||||
self.PoliceVehicleFrameWatchDog = setTimeout(async (MissionID) => {
|
||||
self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
|
||||
$("#adis-sprechwunsch-police-frame").attr("src", "");
|
||||
$("#adis-sprechwunsch-police-frame").attr("mission_id", "empty");
|
||||
});
|
||||
}, 1500, MissionID);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}).catch((err) => {})
|
||||
}
|
||||
|
||||
AddPoliceSprechwunschToQueue(WunschID) {
|
||||
return this.ADisDB.ADisSprechwunschPolice.put({
|
||||
missionID: WunschID,
|
||||
done: 'false'
|
||||
let self = this;
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||
return this.ADisDB.ADisSprechwunschPolice.put({
|
||||
missionID: WunschID,
|
||||
done: 'false'
|
||||
})
|
||||
}).catch((err) => {})
|
||||
}
|
||||
|
||||
UpdatePoliceSprechwunschToDone(WunschID) {
|
||||
return this.ADisDB.ADisSprechwunschPolice.add({
|
||||
missionID: WunschID,
|
||||
done: 'true'
|
||||
let self = this;
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
|
||||
return self.ADisDB.ADisSprechwunschPolice.add({
|
||||
missionID: WunschID,
|
||||
done: 'true'
|
||||
})
|
||||
}).catch((err) => {})
|
||||
}
|
||||
|
||||
@@ -839,11 +847,13 @@ class AutomaticDispose {
|
||||
}
|
||||
|
||||
AddAvailableMissions(Mission) {
|
||||
return this.ADisDB.ADisAvailabelMissions.put({
|
||||
missionID: Mission.id,
|
||||
type: Mission.type,
|
||||
name: Mission.name,
|
||||
jsondata: Mission
|
||||
return self.ADisDB.transaction('rw', [self.ADisDB.ADisAvailabelMissions], async () => {
|
||||
return this.ADisDB.ADisAvailabelMissions.put({
|
||||
missionID: Mission.id,
|
||||
type: Mission.type,
|
||||
name: Mission.name,
|
||||
jsondata: Mission
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.error(err)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user