Browse Source

Breaks the cache

craigsdennis 9 years ago
parent
commit
f6d806f050
1 changed files with 9 additions and 6 deletions
  1. 9 6
      front-end/js/app.js

+ 9 - 6
front-end/js/app.js

@@ -20,12 +20,12 @@ var last_notification = "";
  * Note: Paths are relative to index.html not app.js
  * Note: Paths are relative to index.html not app.js
  ************************/
  ************************/
 
 
+const remote = require("remote");
 const SerialScanner = require("../back-end/serial_scanner");
 const SerialScanner = require("../back-end/serial_scanner");
 const PortSelect = require("./js/port_select");
 const PortSelect = require("./js/port_select");
 const prepareBinaries = require("../back-end/prepare_binaries");
 const prepareBinaries = require("../back-end/prepare_binaries");
 const log = require("../back-end/logger");
 const log = require("../back-end/logger");
 const RomComm = require("../back-end/rom_comm");
 const RomComm = require("../back-end/rom_comm");
-
 const serialScanner = new SerialScanner();
 const serialScanner = new SerialScanner();
 
 
 /************************
 /************************
@@ -147,11 +147,14 @@ function generateManifestList(manifestsJSON) {
 
 
 function getManifests() {
 function getManifests() {
     appStatus.textContent = "Getting latest manifests.";
     appStatus.textContent = "Getting latest manifests.";
-    fetch(CONSTANTS.manifestList)
-        .then(processJSON)
-        .then(generateManifestList).catch(error => {
-            setTimeout(getManifests, pollTime);
-        });
+    // Break the cache to get the latest
+    remote.getCurrentWindow().webContents.session.clearCache(() => {
+        fetch(CONSTANTS.manifestList)
+            .then(processJSON)
+            .then(generateManifestList).catch(error => {
+                setTimeout(getManifests, pollTime);
+            });
+    });
 }
 }
 
 
 function flashWithManifest(manifest) {
 function flashWithManifest(manifest) {