ci: fix swiftformat
This commit is contained in:
@@ -226,7 +226,9 @@ final class CanvasManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static func hasBundledA2UIShell() -> Bool {
|
private static func hasBundledA2UIShell() -> Bool {
|
||||||
guard let base = ClawdisKitResources.bundle.resourceURL?.appendingPathComponent("CanvasA2UI", isDirectory: true) else {
|
guard let base = ClawdisKitResources.bundle.resourceURL?
|
||||||
|
.appendingPathComponent("CanvasA2UI", isDirectory: true)
|
||||||
|
else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
let index = base.appendingPathComponent("index.html", isDirectory: false)
|
let index = base.appendingPathComponent("index.html", isDirectory: false)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Foundation
|
|
||||||
import ClawdisKit
|
import ClawdisKit
|
||||||
|
import Foundation
|
||||||
import OSLog
|
import OSLog
|
||||||
import WebKit
|
import WebKit
|
||||||
|
|
||||||
@@ -250,7 +250,8 @@ final class CanvasSchemeHandler: NSObject, WKURLSchemeHandler {
|
|||||||
let ext = url.pathExtension
|
let ext = url.pathExtension
|
||||||
let name = url.deletingPathExtension().lastPathComponent
|
let name = url.deletingPathExtension().lastPathComponent
|
||||||
guard !name.isEmpty, !ext.isEmpty else { return nil }
|
guard !name.isEmpty, !ext.isEmpty else { return nil }
|
||||||
guard let resourceURL = ClawdisKitResources.bundle.url(forResource: name, withExtension: ext) else { return nil }
|
guard let resourceURL = ClawdisKitResources.bundle.url(forResource: name, withExtension: ext)
|
||||||
|
else { return nil }
|
||||||
return try? Data(contentsOf: resourceURL)
|
return try? Data(contentsOf: resourceURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -677,7 +677,10 @@ private final class CanvasA2UIActionMessageHandler: NSObject, WKScriptMessageHan
|
|||||||
|
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
guard let webView else { return }
|
guard let webView else { return }
|
||||||
let js = ClawdisCanvasA2UIAction.jsDispatchA2UIActionStatus(actionId: actionId, ok: result.ok, error: result.error)
|
let js = ClawdisCanvasA2UIAction.jsDispatchA2UIActionStatus(
|
||||||
|
actionId: actionId,
|
||||||
|
ok: result.ok,
|
||||||
|
error: result.error)
|
||||||
webView.evaluateJavaScript(js) { _, _ in }
|
webView.evaluateJavaScript(js) { _, _ in }
|
||||||
}
|
}
|
||||||
if !result.ok {
|
if !result.ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user