Fix deprecation warning.

This commit is contained in:
Brent Simmons 2024-11-06 21:13:41 -08:00
parent 5506187d51
commit 8cf388e55c

View File

@ -128,9 +128,12 @@ public class RSAppMovementMonitor: NSObject {
func relaunchFromURL(_ appURL: URL) {
// Relaunching is best achieved by requesting that the system launch the app
// at the given URL with the "new instance" option to prevent it simply reactivating us.
let _ = try? NSWorkspace.shared.launchApplication(at: appURL, options: .newInstance, configuration: [:])
let configuration = NSWorkspace.OpenConfiguration()
configuration.createsNewApplicationInstance = true
NSWorkspace.shared.openApplication(at: appURL, configuration: configuration) { _,_ in
NSApp.terminate(self)
}
}
func defaultHandler() {
let quitAlert = NSAlert()