fix(canvas): load A2UI resources across platforms

This commit is contained in:
Peter Steinberger
2025-12-19 01:53:35 +00:00
parent 95ea67de28
commit b8012a2281
6 changed files with 45 additions and 22 deletions

View File

@@ -226,12 +226,10 @@ final class CanvasManager {
}
private static func hasBundledA2UIShell() -> Bool {
guard let base = ClawdisKitResources.bundle.resourceURL?
.appendingPathComponent("CanvasA2UI", isDirectory: true)
else {
return false
let bundle = ClawdisKitResources.bundle
if bundle.url(forResource: "index", withExtension: "html", subdirectory: "CanvasA2UI") != nil {
return true
}
let index = base.appendingPathComponent("index.html", isDirectory: false)
return FileManager.default.fileExists(atPath: index.path)
return bundle.url(forResource: "index", withExtension: "html") != nil
}
}