Browse Source

Fix Retry Button Bug

Ayush Sharma 4 years ago
parent
commit
6ff76510f1
3 changed files with 8 additions and 6 deletions
  1. 0 1
      src/elegantWebpage.h
  2. 7 4
      ui/src/App.vue
  3. 1 1
      ui/vue.config.js

File diff suppressed because it is too large
+ 0 - 1
src/elegantWebpage.h


+ 7 - 4
ui/src/App.vue

@@ -144,7 +144,7 @@ export default {
       OTASuccess: false,
 
       type: 'firmware',
-      files: null,
+      file: null,
       deviceData: {
         id: null,
         hardware: null,
@@ -153,10 +153,13 @@ export default {
   },
 
   methods: {
-    uploadOTA() {
+    uploadOTA(event) {
       this.uploading = true;
       const formData = new FormData();
-      formData.append(this.type, this.$refs.file.files[0]);
+      if(event !== null){
+        this.file = event.target.files[0];
+      }
+      formData.append(this.type, this.file);
       const request = new XMLHttpRequest();
 
       request.addEventListener('load', () => {
@@ -185,7 +188,7 @@ export default {
     retryOTA() {
       this.OTAError = null;
       this.OTASuccess = false;
-      this.uploadOTA();
+      this.uploadOTA(null);
     },
 
     clear() {

+ 1 - 1
ui/vue.config.js

@@ -11,5 +11,5 @@ module.exports = {
   filenameHashing: false,
   chainWebpack: (config) => {
     config.optimization.delete('splitChunks');
-  }
+  },
 };

Some files were not shown because too many files changed in this diff