refactor reinit

should fix an issue when the user presses retry before the websocket fully disconnects
This commit is contained in:
alfrix
2024-05-13 10:07:56 -03:00
parent 19c083b286
commit 7dd62decaf
4 changed files with 17 additions and 6 deletions

View File

@@ -13,6 +13,12 @@ class KlippyFiles:
self.directories = []
self.gcodes_path = None
def reinit(self):
self.callbacks.clear()
self.files.clear()
self.directories.clear()
self.gcodes_path = None
def set_gcodes_path(self):
virtual_sdcard = self._screen.printer.get_config_section("virtual_sdcard")
if virtual_sdcard and "path" in virtual_sdcard: