Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
app: open app instead of always navigating to / on connect (#13164)
Jeffrey Morgan417a81fda3ce
diff --git a/app/cmd/app/app.go b/app/cmd/app/app.goindex ef282fd05..d09e04b54 100644--- a/app/cmd/app/app.go+++ b/app/cmd/app/app.go@@ -397,8 +397,8 @@ func checkUserLoggedIn(uiServerPort int) bool {// handleConnectURLScheme fetches the connect URL and opens it in the browserfunc handleConnectURLScheme() {if checkUserLoggedIn(uiServerPort) {- slog.Info("user is already logged in, opening settings instead")- sendUIRequestMessage("/")+ slog.Info("user is already logged in, opening app instead")+ showWindow(wv.webview.Window())return}@@ -466,6 +466,8 @@ func handleURLSchemeInCurrentInstance(urlSchemeRequest string) {if isConnect {handleConnectURLScheme()} else {- sendUIRequestMessage("/")+ if wv.webview != nil {+ showWindow(wv.webview.Window())+ }}}diff --git a/app/cmd/app/app_darwin.m b/app/cmd/app/app_darwin.mindex 4e1d52f76..a983a2f01 100644--- a/app/cmd/app/app_darwin.m+++ b/app/cmd/app/app_darwin.m@@ -24,27 +24,14 @@ bool firstTimeRun,startHidden; // Set in run before initializationfor (NSURL *url in urls) {if ([url.scheme isEqualToString:@"ollama"]) {NSString *path = url.path;- if (!path || [path isEqualToString:@""]) {- // For URLs like ollama://settings (without triple slash),- // the "settings" part is parsed as the host, not the path.- // We need to convert it to a path by prepending "/"- if (url.host && ![url.host isEqualToString:@""]) {- path = [@"/" stringByAppendingString:url.host];- } else {- path = @"/";- }- }-- if ([path isEqualToString:@"/connect"] || [url.host isEqualToString:@"connect"]) {++ if (path && ([path isEqualToString:@"/connect"] || [url.host isEqualToString:@"connect"])) {// Special case: handle connect by opening browser instead of apphandleConnectURL();} else {// Set app to be active and visible[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];[NSApp activateIgnoringOtherApps:YES];-- // Open the path with the UI- [self uiRequest:path];}break;diff --git a/app/cmd/app/app_windows.go b/app/cmd/app/app_windows.goindex 8a4876408..b563d4098 100644--- a/app/cmd/app/app_windows.go+++ b/app/cmd/app/app_windows.go@@ -147,7 +147,9 @@ func handleURLSchemeRequest(urlScheme string) {if isConnect {handleConnectURLScheme()} else {- sendUIRequestMessage("/")+ if wv.webview != nil {+ showWindow(wv.webview.Window())+ }}}