Fix saving file drop saving for "all" (#967)

This commit is contained in:
1024jp 2021-10-24 10:39:48 +09:00
parent f675f15d0b
commit fe910a26ed
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,9 @@ Change Log
4.0.9 (471)
--------------------------
### Fixes
- Fix an issue that File Drop settings were not saved if both the extensions and syntax styles are for “all.”

View File

@ -190,7 +190,7 @@ final class FileDropPaneController: NSViewController, NSTableViewDelegate, NSTex
// sanitize
let sanitized = content
.map { $0.filter { !($0.key == FileDropItem.CodingKeys.extensions.rawValue && $0.value.isEmpty) } }
.filter { $0[FileDropItem.CodingKeys.extensions.rawValue] != nil || $0[FileDropItem.CodingKeys.scope.rawValue] != nil }
.filter { $0[FileDropItem.CodingKeys.format.rawValue] != nil }
// check if the new setting is different from the default
let defaultSetting = UserDefaults.standard.registeredValue(for: .fileDropArray)