Fixed 'cannot close app on first setup'

This commit is contained in:
jeffser 2024-05-16 09:50:35 -06:00
parent 76486da3d4
commit d1fbdad486
2 changed files with 16 additions and 19 deletions

View File

@ -64,8 +64,7 @@
"sources" : [ "sources" : [
{ {
"type" : "git", "type" : "git",
"url" : "https://github.com/Jeffser/Alpaca.git", "url" : "file:///home/tentri/Documents/Alpaca"
"tag": "0.2.2"
} }
] ]
} }

View File

@ -361,6 +361,7 @@ class AlpacaWindow(Adw.ApplicationWindow):
if result == "cancel": return if result == "cancel": return
if result == "save": if result == "save":
self.ollama_url = self.connection_url_entry.get_text() self.ollama_url = self.connection_url_entry.get_text()
elif result == "discard" and self.ollama_url is None: self.destroy()
self.connection_dialog.force_close() self.connection_dialog.force_close()
if self.ollama_url is None or self.verify_connection() == False: if self.ollama_url is None or self.verify_connection() == False:
self.show_connection_dialog(True) self.show_connection_dialog(True)
@ -368,9 +369,6 @@ class AlpacaWindow(Adw.ApplicationWindow):
def closing_connection_dialog(self, dialog): def closing_connection_dialog(self, dialog):
if self.get_visible() == False:
self.destroy()
else:
dialog = Adw.AlertDialog( dialog = Adw.AlertDialog(
heading=f"Save Changes?", heading=f"Save Changes?",
body=f"Do you want to save the URL change?", body=f"Do you want to save the URL change?",