watch now removes fingerprint, if it no longer works and pulls a new one
This commit is contained in:
parent
1662c81d18
commit
60a337ecbc
Binary file not shown.
14
js/app.js
14
js/app.js
@ -226,7 +226,7 @@ var eventsTimeStamp = 0;
|
|||||||
function deleteCallback() {
|
function deleteCallback() {
|
||||||
console.log("done");
|
console.log("done");
|
||||||
console.log("getting new calendar events");
|
console.log("getting new calendar events");
|
||||||
getFileFromServer("userinfo/" + deviceFingerprint.deviceId + "/calendarevents.json", readJSON);
|
getFileFromServer("device/" + deviceFingerprint.deviceName + "/calendarevents.json", readJSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("deleting calendarevents");
|
console.log("deleting calendarevents");
|
||||||
@ -480,14 +480,20 @@ var eventsTimeStamp = 0;
|
|||||||
if(events == null)
|
if(events == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* if device not on server anymore */
|
||||||
|
if(events.kind == "not found") {
|
||||||
|
deviceFingerprint = null;
|
||||||
|
events = null;
|
||||||
|
deleteFile("devicefingerprint", function() {});
|
||||||
|
wait_time = SHORT_WAIT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
/* if device not registered */
|
/* if device not registered */
|
||||||
if(events.kind == "unregistered") {
|
if(events.kind == "unregistered") {
|
||||||
wait_time = SHORT_WAIT;
|
wait_time = SHORT_WAIT;
|
||||||
if(deviceFingerprint === null) {
|
if(deviceFingerprint === null) {
|
||||||
console.log("no fingerprint to render");
|
|
||||||
} else {
|
} else {
|
||||||
console.log("rendering text");
|
renderText(ctxContent, deviceFingerprint.deviceName, center.x, center.y, 20, "FF0000");
|
||||||
renderText(ctxContent, deviceFingerprint.deviceId, center.x, center.y, 20, "FF0000");
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user