Skip to content

Commit ecef77c

Browse files
committed
fix macOS Frontend config crash on macOS 26
1 parent a971108 commit ecef77c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/config/appimoptionview.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ private let presetApps: [String] = [
1010

1111
struct AppIMOptionView: OptionView {
1212
let label: String
13-
let openPanel = NSOpenPanel()
1413
@ObservedObject var model: AppIMOption
1514
@State private var appIcon: NSImage? = nil
1615
@State private var imNameMap: [String: String] = [:]
@@ -23,6 +22,7 @@ struct AppIMOptionView: OptionView {
2322
}
2423

2524
var body: some View {
25+
let openPanel = NSOpenPanel() // macOS 26 crashes if put outside of body.
2626
HStack {
2727
if !model.appPath.isEmpty {
2828
appIconFromPath(model.appPath)

src/config/vimmodeoptionview.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import SwiftUI
22

33
struct VimModeOptionView: OptionView {
44
let label: String
5-
let openPanel = NSOpenPanel()
65
@ObservedObject var model: VimModeOption
76

87
var body: some View {
8+
let openPanel = NSOpenPanel() // macOS 26 crashes if put outside of body.
99
HStack {
1010
let appPath = appPathFromBundleIdentifier(model.value)
1111
let appName = appNameFromPath(appPath)

0 commit comments

Comments
 (0)