File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
ConfigForge/Views/Editors Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -252,11 +252,10 @@ struct ModernEntryEditorView: View {
252252 openPanel. allowsMultipleSelection = false
253253 openPanel. allowedContentTypes = [ . text, . data] // Allow common key file types
254254
255- openPanel. begin { ( result) in
256- if result == . OK, let url = openPanel. url {
257- DispatchQueue . main. async {
258- // Ensure index is still valid before updating, though less likely an issue here
259- if editedDirectives. indices. contains ( index) {
255+ openPanel. begin { result in
256+ if result == . OK {
257+ Task { @MainActor in
258+ if let url = openPanel. url, editedDirectives. indices. contains ( index) {
260259 editedDirectives [ index] . value = url. path
261260 print ( " Selected file path for directive at index \( index) : \( url. path) " )
262261 }
@@ -444,4 +443,4 @@ struct ModernEntryEditorView: View {
444443 private func addAdvancedDirective( ) {
445444 editedDirectives. append ( ( key: " " , value: " " ) )
446445 }
447- }
446+ }
You can’t perform that action at this time.
0 commit comments