|
@@ -10,7 +10,7 @@
|
|
*/
|
|
*/
|
|
const CONSTANTS = {
|
|
const CONSTANTS = {
|
|
manifestList: "http://flasher.thingssdk.com/v1/manifest-list.json",
|
|
manifestList: "http://flasher.thingssdk.com/v1/manifest-list.json",
|
|
- pollTime: 100
|
|
|
|
|
|
+ pollTime: 1000
|
|
};
|
|
};
|
|
|
|
|
|
var isFlashing = false;
|
|
var isFlashing = false;
|
|
@@ -73,7 +73,7 @@ function processJSON(response) {
|
|
flashButton.addEventListener("click", (event) => {
|
|
flashButton.addEventListener("click", (event) => {
|
|
isFlashing = true;
|
|
isFlashing = true;
|
|
disableInputs();
|
|
disableInputs();
|
|
- prepareUIForFlashing(()=>{
|
|
|
|
|
|
+ prepareUIForFlashing(() => {
|
|
fetch(manifestsSelect.value)
|
|
fetch(manifestsSelect.value)
|
|
.then(processJSON)
|
|
.then(processJSON)
|
|
.then(flashWithManifest);
|
|
.then(flashWithManifest);
|
|
@@ -118,15 +118,19 @@ function readyToFlash() {
|
|
* Enabled the serial port SELECT and flash BUTTON elements.
|
|
* Enabled the serial port SELECT and flash BUTTON elements.
|
|
*/
|
|
*/
|
|
function enableInputs() {
|
|
function enableInputs() {
|
|
- portsSelect.disabled = false;
|
|
|
|
- manifestsSelect.disabled = false;
|
|
|
|
- flashButton.disabled = false;
|
|
|
|
|
|
+ if(flashButton.disabled) {
|
|
|
|
+ portsSelect.disabled = false;
|
|
|
|
+ manifestsSelect.disabled = false;
|
|
|
|
+ flashButton.disabled = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function disableInputs() {
|
|
function disableInputs() {
|
|
- portsSelect.disabled = true;
|
|
|
|
- manifestsSelect.disabled = true;
|
|
|
|
- flashButton.disabled = true;
|
|
|
|
|
|
+ if(!flashButton.disabled) {
|
|
|
|
+ portsSelect.disabled = true;
|
|
|
|
+ manifestsSelect.disabled = true;
|
|
|
|
+ flashButton.disabled = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|