mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-04 22:31:40 +00:00
* fix(macos): support background-only launches * fix(macos): refresh native i18n inventory * fix(i18n): refresh native inventory after main sync
27 lines
709 B
Swift
27 lines
709 B
Swift
import Foundation
|
|
|
|
struct AppLaunchPresentationPolicy: Equatable {
|
|
let backgroundOnly: Bool
|
|
|
|
init(arguments: [String]) {
|
|
self.backgroundOnly = arguments.contains("--background-only")
|
|
}
|
|
|
|
static var current: Self {
|
|
Self(arguments: CommandLine.arguments)
|
|
}
|
|
|
|
var allowsAutomaticPresentation: Bool {
|
|
!self.backgroundOnly
|
|
}
|
|
|
|
func shouldAutoOpenChat(arguments: [String]) -> Bool {
|
|
self.allowsAutomaticPresentation &&
|
|
(arguments.contains("--chat") || arguments.contains("--webchat"))
|
|
}
|
|
|
|
func shouldAutoOpenDashboard(arguments: [String]) -> Bool {
|
|
self.allowsAutomaticPresentation && arguments.contains("--dashboard")
|
|
}
|
|
}
|