mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +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() {
|
||||
let consoleObject = JSValue(newObjectIn: self)
|
||||
|
||||
let appInfoBridge = AppInfo()
|
||||
consoleObject?.setObject(appInfoBridge, forKeyedSubscript: "AppInfo" as NSString)
|
||||
|
||||
let consoleLogFunction: @convention(block) (String) -> Void = { message in
|
||||
Logger.shared.log(message, type: "Debug")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,18 +23,8 @@ class JSController: ObservableObject {
|
|||
context = JSContext()
|
||||
setupContext()
|
||||
context.evaluateScript(script)
|
||||
|
||||
let appInfoBridge = AppInfo()
|
||||
context.setObject(appInfoBridge, forKeyedSubscript: "AppInfo" as NSString)
|
||||
|
||||
if let exception = context.exception {
|
||||
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