From 8cf388e55cd73e2880ec91131776fb9c5d0f234d Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 6 Nov 2024 21:13:41 -0800 Subject: [PATCH] Fix deprecation warning. --- RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift b/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift index 83c1d49fb..089acb33f 100644 --- a/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift +++ b/RSCore/Sources/RSCore/AppKit/RSAppMovementMonitor.swift @@ -128,8 +128,11 @@ 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: [:]) - NSApp.terminate(self) + let configuration = NSWorkspace.OpenConfiguration() + configuration.createsNewApplicationInstance = true + NSWorkspace.shared.openApplication(at: appURL, configuration: configuration) { _,_ in + NSApp.terminate(self) + } } func defaultHandler() {