|
|
@@ -14,6 +14,7 @@ class Puzzeltocht {
|
|
|
this.missionScreen = new MissionScreen();
|
|
|
this.missionScreen.setAnswerListener(e => this.answer(e));
|
|
|
this.location = new LocationApi();
|
|
|
+ this.location.enable(p => this.updateLocation(p))
|
|
|
console.log("puzzeltocht initialised");
|
|
|
}
|
|
|
|
|
|
@@ -22,7 +23,7 @@ class Puzzeltocht {
|
|
|
this.teamId = teamId;
|
|
|
document.getElementById("join").style.display = "none";
|
|
|
document.getElementById("mission").style.display = "block";
|
|
|
- this.location.enable(p => this.updateLocation(p))
|
|
|
+ // this.location.enable(p => this.updateLocation(p))
|
|
|
}
|
|
|
|
|
|
answer(a) {
|
|
|
@@ -45,6 +46,10 @@ class Puzzeltocht {
|
|
|
this.position = position;
|
|
|
l.innerText = position.string();
|
|
|
|
|
|
+ if (this.eventId === null || this.eventId === undefined) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (this.lastUpdate === undefined || Date.now() - this.lastUpdate > 5000) {
|
|
|
Api.sendUpdate(this.eventId, this.teamId, position)
|
|
|
.then(m => {
|