diff --git a/src/window.py b/src/window.py index 6a6fc84..7870f92 100644 --- a/src/window.py +++ b/src/window.py @@ -881,12 +881,16 @@ class AlpacaWindow(Adw.ApplicationWindow): def connection_switched(self): new_value = self.remote_connection_switch.get_active() + + if new_value != self.run_remote: self.run_remote = new_value if self.run_remote: - self.stop_instance() + self.ollama_url = self.remote_url if self.verify_connection() == False: self.connection_error() + else: self.stop_instance() else: + self.ollama_url = f"http://127.0.0.1:{self.local_ollama_port}" self.start_instance() if self.verify_connection() == False: self.connection_error() self.update_list_available_models() diff --git a/src/window.ui b/src/window.ui index b87dbaf..ad7a9f1 100644 --- a/src/window.ui +++ b/src/window.ui @@ -4,7 +4,7 @@