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