From 1fe7588986cf262b44f588e7c3fda8a0a79ad8aa Mon Sep 17 00:00:00 2001 From: Fernando Bunn Date: Thu, 5 Dec 2024 17:28:53 -0300 Subject: [PATCH] build for alexis --- DuckDuckGo/AIChat/AIChatSettings.swift | 5 ++-- .../AIChat/AIChatWebViewController.swift | 24 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/DuckDuckGo/AIChat/AIChatSettings.swift b/DuckDuckGo/AIChat/AIChatSettings.swift index dfddab74d1..126e34048f 100644 --- a/DuckDuckGo/AIChat/AIChatSettings.swift +++ b/DuckDuckGo/AIChat/AIChatSettings.swift @@ -30,7 +30,8 @@ struct AIChatSettings: AIChatSettingsProvider { var defaultValue: String { switch self { - case .aiChatURL: return "https://duckduckgo.com/?q=DuckDuckGo+AI+Chat&ia=chat&duckai=4" + /// https://app.asana.com/0/1208541424548398/1208567543352020/f + case .aiChatURL: return "https://ahushbeck.duckduckgo.com" } } } @@ -103,7 +104,7 @@ struct AIChatSettings: AIChatSettingsProvider { } private func getSettingsData(_ value: SettingsValue) -> String { - if let value = remoteSettings[value.rawValue] as? String { + if let value = remoteSettings["potato"] as? String { return value } else { Pixel.fire(pixel: .aiChatNoRemoteSettingsFound(settings: value.rawValue)) diff --git a/LocalPackages/AIChat/Sources/AIChat/AIChatWebViewController.swift b/LocalPackages/AIChat/Sources/AIChat/AIChatWebViewController.swift index ec0d1d5d2d..bbb694bcea 100644 --- a/LocalPackages/AIChat/Sources/AIChat/AIChatWebViewController.swift +++ b/LocalPackages/AIChat/Sources/AIChat/AIChatWebViewController.swift @@ -102,18 +102,18 @@ extension AIChatWebViewController { extension AIChatWebViewController: WKNavigationDelegate { - func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction) async -> WKNavigationActionPolicy { - if let url = navigationAction.request.url { - if url == chatModel.aiChatURL || navigationAction.targetFrame?.isMainFrame == false { - return .allow - } else { - delegate?.aiChatWebViewController(self, didRequestToLoad: url) - return .cancel - } - } else { - return .allow - } - } +// func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction) async -> WKNavigationActionPolicy { +// if let url = navigationAction.request.url { +// if url == chatModel.aiChatURL || navigationAction.targetFrame?.isMainFrame == false { +// return .allow +// } else { +// delegate?.aiChatWebViewController(self, didRequestToLoad: url) +// return .cancel +// } +// } else { +// return .allow +// } +// } func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { loadingView.startAnimating()