@@ -51,6 +51,7 @@ import { SocketActions } from '@/socketActions'
5151import DialogFileEditor from ' @/components/dialogs/dialogFileEditor.vue'
5252import UtilsMixin from ' @/mixins/utils'
5353import { KlipperFile } from ' @/store/files/types'
54+ import { Waits } from ' @/globals'
5455
5556@Component ({
5657 components: {
@@ -140,15 +141,21 @@ export default class FileSystemCard extends Mixins(UtilsMixin) {
140141 filename = ` ${path }/${filename } ` .substring (7 )
141142 formData .append (' file' , file , filename )
142143 formData .append (' root' , root )
143- return this .$http .post (
144- this .apiUrl + ' /server/files/upload' ,
145- formData ,
146- {
147- headers: {
148- ' Content-Type' : ' multipart/form-data'
144+ this .$store .dispatch (' socket/addWait' , Waits .onUploadGcode )
145+ console .log (' uploading, set wait' , Waits .onUploadGcode )
146+ return this .$http
147+ .post (
148+ this .apiUrl + ' /server/files/upload' ,
149+ formData , {
150+ headers: {
151+ ' Content-Type' : ' multipart/form-data'
152+ }
149153 }
150- }
151- )
154+ )
155+ .finally (() => {
156+ console .log (' finished uploading, remove wait' , Waits .onUploadGcode )
157+ this .$store .dispatch (' socket/removeWait' , Waits .onUploadGcode )
158+ })
152159 }
153160
154161 saveEdit (content : string , filename : string , path : string ) {
0 commit comments