| ... | ... |
@@ -41,7 +41,15 @@ sender.addEventListener("error", uploadError);
|
| 41 | 41 |
|
| 42 | 42 |
Pebble.addEventListener("ready", function() {
|
| 43 | 43 |
console.log("Health Export PebbleKit JS ready!");
|
| 44 |
- Pebble.sendAppMessage({ "modalMessage": "Not configured" });
|
|
| 44 |
+ |
|
| 45 |
+ cfg_endpoint = localStorage.getItem("cfgEndpoint");
|
|
| 46 |
+ cfg_data_field = localStorage.getItem("cfgDataField");
|
|
| 47 |
+ |
|
| 48 |
+ if (cfg_endpoint && cfg_data_field) {
|
|
| 49 |
+ Pebble.sendAppMessage({ "lastSent": 0 });
|
|
| 50 |
+ } else {
|
|
| 51 |
+ Pebble.sendAppMessage({ "modalMessage": "Not configured" });
|
|
| 52 |
+ } |
|
| 45 | 53 |
}); |
| 46 | 54 |
|
| 47 | 55 |
Pebble.addEventListener("appmessage", function(e) {
|
| ... | ... |
@@ -71,10 +79,12 @@ Pebble.addEventListener("webviewclosed", function(e) {
|
| 71 | 79 |
|
| 72 | 80 |
if (configData.url) {
|
| 73 | 81 |
cfg_endpoint = configData.url; |
| 82 |
+ localStorage.setItem("cfgEndpoint", cfg_endpoint);
|
|
| 74 | 83 |
} |
| 75 | 84 |
|
| 76 | 85 |
if (configData.dataField) {
|
| 77 | 86 |
cfg_data_field = configData.dataField; |
| 87 |
+ localStorage.setItem("cfgDataField", cfg_data_field);
|
|
| 78 | 88 |
} |
| 79 | 89 |
|
| 80 | 90 |
if (!wasConfigured && cfg_endpoint && cfg_data_field) {
|