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.
16
js/app.js
16
js/app.js
@ -226,8 +226,8 @@ var eventsTimeStamp = 0;
|
||||
function deleteCallback() {
|
||||
console.log("done");
|
||||
console.log("getting new calendar events");
|
||||
getFileFromServer("userinfo/" + deviceFingerprint.deviceId + "/calendarevents.json", readJSON);
|
||||
}
|
||||
getFileFromServer("device/" + deviceFingerprint.deviceName + "/calendarevents.json", readJSON);
|
||||
}
|
||||
|
||||
console.log("deleting calendarevents");
|
||||
deleteFile("calendarevents", deleteCallback);
|
||||
@ -480,14 +480,20 @@ var eventsTimeStamp = 0;
|
||||
if(events == null)
|
||||
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(events.kind == "unregistered") {
|
||||
wait_time = SHORT_WAIT;
|
||||
if(deviceFingerprint === null) {
|
||||
console.log("no fingerprint to render");
|
||||
} else {
|
||||
console.log("rendering text");
|
||||
renderText(ctxContent, deviceFingerprint.deviceId, center.x, center.y, 20, "FF0000");
|
||||
renderText(ctxContent, deviceFingerprint.deviceName, center.x, center.y, 20, "FF0000");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user