Skip to content

Commit fa6ecb8

Browse files
committed
fix: allow saving empty files
Signed-off-by: Pedro Lamas <[email protected]>
1 parent 585758a commit fa6ecb8

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/components/widgets/filesystem/FileSystem.vue

+14-16
Original file line numberDiff line numberDiff line change
@@ -846,23 +846,21 @@ export default class FileSystem extends Mixins(StateMixin, FilesMixin, ServicesM
846846
}
847847
848848
async handleSaveFileChanges (contents: string, restart: string) {
849-
if (contents.length > 0) {
850-
const file = new File([contents], this.fileEditorDialogState.filename)
851-
if (!restart && this.fileEditorDialogState.open) this.fileEditorDialogState.loading = true
852-
853-
await this.uploadFile(file, this.visiblePath, this.currentRoot, false)
854-
this.fileEditorDialogState.loading = false
855-
if (restart) {
856-
if (restart === 'moonraker') {
857-
this.serviceRestartMoonraker()
858-
return
859-
}
860-
if (restart === 'klipper') {
861-
this.firmwareRestartKlippy()
862-
return
863-
}
864-
this.serviceRestartByName(restart)
849+
const file = new File([contents], this.fileEditorDialogState.filename)
850+
if (!restart && this.fileEditorDialogState.open) this.fileEditorDialogState.loading = true
851+
852+
await this.uploadFile(file, this.visiblePath, this.currentRoot, false)
853+
this.fileEditorDialogState.loading = false
854+
if (restart) {
855+
if (restart === 'moonraker') {
856+
this.serviceRestartMoonraker()
857+
return
858+
}
859+
if (restart === 'klipper') {
860+
this.firmwareRestartKlippy()
861+
return
865862
}
863+
this.serviceRestartByName(restart)
866864
}
867865
}
868866

0 commit comments

Comments
 (0)