style(ios): swiftformat
This commit is contained in:
@@ -35,7 +35,7 @@ final class NodeAppModel {
|
|||||||
|
|
||||||
let enabled = UserDefaults.standard.bool(forKey: "voiceWake.enabled")
|
let enabled = UserDefaults.standard.bool(forKey: "voiceWake.enabled")
|
||||||
self.voiceWake.setEnabled(enabled)
|
self.voiceWake.setEnabled(enabled)
|
||||||
|
|
||||||
// Wire up deep links from canvas taps
|
// Wire up deep links from canvas taps
|
||||||
self.screen.onDeepLink = { [weak self] url in
|
self.screen.onDeepLink = { [weak self] url in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ final class ScreenController {
|
|||||||
var mode: ClawdisScreenMode = .canvas
|
var mode: ClawdisScreenMode = .canvas
|
||||||
var urlString: String = ""
|
var urlString: String = ""
|
||||||
var errorText: String?
|
var errorText: String?
|
||||||
|
|
||||||
/// Callback invoked when a clawdis:// deep link is tapped in the canvas
|
/// Callback invoked when a clawdis:// deep link is tapped in the canvas
|
||||||
var onDeepLink: ((URL) -> Void)?
|
var onDeepLink: ((URL) -> Void)?
|
||||||
|
|
||||||
@@ -252,17 +252,17 @@ final class ScreenController {
|
|||||||
/// Handles navigation policy to intercept clawdis:// deep links from canvas
|
/// Handles navigation policy to intercept clawdis:// deep links from canvas
|
||||||
private final class ScreenNavigationDelegate: NSObject, WKNavigationDelegate {
|
private final class ScreenNavigationDelegate: NSObject, WKNavigationDelegate {
|
||||||
weak var controller: ScreenController?
|
weak var controller: ScreenController?
|
||||||
|
|
||||||
func webView(
|
func webView(
|
||||||
_ webView: WKWebView,
|
_ webView: WKWebView,
|
||||||
decidePolicyFor navigationAction: WKNavigationAction,
|
decidePolicyFor navigationAction: WKNavigationAction,
|
||||||
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void
|
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void)
|
||||||
) {
|
{
|
||||||
guard let url = navigationAction.request.url else {
|
guard let url = navigationAction.request.url else {
|
||||||
decisionHandler(.allow)
|
decisionHandler(.allow)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Intercept clawdis:// deep links
|
// Intercept clawdis:// deep links
|
||||||
if url.scheme == "clawdis" {
|
if url.scheme == "clawdis" {
|
||||||
decisionHandler(.cancel)
|
decisionHandler(.cancel)
|
||||||
@@ -271,7 +271,7 @@ private final class ScreenNavigationDelegate: NSObject, WKNavigationDelegate {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
decisionHandler(.allow)
|
decisionHandler(.allow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user