Skip to content

Commit

Permalink
build for alexis
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunn committed Dec 5, 2024
1 parent 8f0cc49 commit 1fe7588
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions DuckDuckGo/AIChat/AIChatSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down Expand Up @@ -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))
Expand Down
24 changes: 12 additions & 12 deletions LocalPackages/AIChat/Sources/AIChat/AIChatWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1fe7588

Please sign in to comment.