1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 12:00:09 +02:00

🐛 Fix concurrency crashes with @objc methods

This commit is contained in:
2023-01-12 17:19:28 +01:00
parent d6258f54a9
commit c82ea1fac1
2 changed files with 8 additions and 8 deletions

View File

@ -33,8 +33,8 @@ class Application {
Attempt to open a specific directory in the app of choice.
(This will open the app if it isn't open yet.)
*/
@objc public func openDirectory(file: String) async {
return await Shell.quiet("/usr/bin/open -a \"\(name)\" \"\(file)\"")
@objc public func openDirectory(file: String) {
Task { await Shell.quiet("/usr/bin/open -a \"\(name)\" \"\(file)\"") }
}
/** Checks if the app is installed. */

View File

@ -30,17 +30,17 @@ extension DomainListVC {
NSWorkspace.shared.open(url)
}
@objc func openInFinder() async {
await Shell.quiet("open '\(selectedSite!.absolutePath)'")
@objc func openInFinder() {
Task { return await Shell.quiet("open '\(selectedSite!.absolutePath)'") }
}
@objc func openInTerminal() async {
await Shell.quiet("open -b com.apple.terminal '\(selectedSite!.absolutePath)'")
@objc func openInTerminal() {
Task { await Shell.quiet("open -b com.apple.terminal '\(selectedSite!.absolutePath)'") }
}
@objc func openWithEditor(sender: EditorMenuItem) async {
@objc func openWithEditor(sender: EditorMenuItem) {
guard let editor = sender.editor else { return }
await editor.openDirectory(file: selectedSite!.absolutePath)
editor.openDirectory(file: selectedSite!.absolutePath)
}
// MARK: - UI interaction