Display the NSAlert window asynchronously to prevent the “OK” button from not appearing
This commit is contained in:
Leopold
2025-09-28 15:32:18 +02:00
parent 5362847a49
commit 339ecb2de3

View File

@@ -579,9 +579,11 @@ struct popover: View {
if #available(macOS 14, *) {
Button(action: {
copyToClipboard(allDevices[index].deviceName)
_ = createAlert(title: "Device Name Copied".local,
message: String(format: "Device name \"%@\" has been copied to the clipboard.".local, allDevices[index].deviceName),
button1: "OK".local).runModal()
DispatchQueue.main.async {
_ = createAlert(title: "Device Name Copied".local,
message: String(format: "Device name \"%@\" has been copied to the clipboard.".local, allDevices[index].deviceName),
button1: "OK".local).runModal()
}
}, label: {
Image("list.clipboard.fill.circle")
.resizable().scaledToFit()