From 77904b3dd2eb099eceedc3173c063586502e937e Mon Sep 17 00:00:00 2001 From: jeffser Date: Wed, 22 May 2024 19:08:17 -0600 Subject: [PATCH] Fixed, remote connection switch --- src/window.py | 6 +++++- src/window.ui | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) 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 @@