Refactor empty filename handling in Save As to use a negative condition

This commit is contained in:
Isaiah Odhner 2023-04-20 22:41:45 -04:00
parent a23eeaf1dd
commit 1f260aaeef

View File

@ -1028,7 +1028,8 @@ class PaintApp(App):
window.close() window.close()
return return
name = self.query_one("#save_as_dialog_filename_input", Input).value name = self.query_one("#save_as_dialog_filename_input", Input).value
if name: if not name:
return
if self.directory_tree_selected_path: if self.directory_tree_selected_path:
name = os.path.join(self.directory_tree_selected_path, name) name = os.path.join(self.directory_tree_selected_path, name)
def on_save_confirmed(): def on_save_confirmed():