mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 08:32:00 +00:00
nvm my bad
This commit is contained in:
parent
73256c5aab
commit
64db1abf0f
3 changed files with 9 additions and 10 deletions
|
|
@ -130,3 +130,9 @@ struct SoraApp: App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AppInfo: NSObject {
|
||||||
|
@objc func getBundleIdentifier() -> String {
|
||||||
|
return Bundle.main.bundleIdentifier ?? "me.cranci.sulfur"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ extension JSContext {
|
||||||
func setupConsoleLogging() {
|
func setupConsoleLogging() {
|
||||||
let consoleObject = JSValue(newObjectIn: self)
|
let consoleObject = JSValue(newObjectIn: self)
|
||||||
|
|
||||||
|
let appInfoBridge = AppInfo()
|
||||||
|
consoleObject?.setObject(appInfoBridge, forKeyedSubscript: "AppInfo" as NSString)
|
||||||
|
|
||||||
let consoleLogFunction: @convention(block) (String) -> Void = { message in
|
let consoleLogFunction: @convention(block) (String) -> Void = { message in
|
||||||
Logger.shared.log(message, type: "Debug")
|
Logger.shared.log(message, type: "Debug")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,18 +23,8 @@ class JSController: ObservableObject {
|
||||||
context = JSContext()
|
context = JSContext()
|
||||||
setupContext()
|
setupContext()
|
||||||
context.evaluateScript(script)
|
context.evaluateScript(script)
|
||||||
|
|
||||||
let appInfoBridge = AppInfo()
|
|
||||||
context.setObject(appInfoBridge, forKeyedSubscript: "AppInfo" as NSString)
|
|
||||||
|
|
||||||
if let exception = context.exception {
|
if let exception = context.exception {
|
||||||
Logger.shared.log("Error loading script: \(exception)", type: "Error")
|
Logger.shared.log("Error loading script: \(exception)", type: "Error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppInfo: NSObject {
|
|
||||||
@objc func getBundleIdentifier() -> String {
|
|
||||||
return Bundle.main.bundleIdentifier ?? "me.cranci.sulfur"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue