macOS: fix config form rendering

This commit is contained in:
Shadow
2026-01-16 16:19:42 -06:00
committed by Peter Steinberger
parent cc2d617ea6
commit 3ec221c70e
3 changed files with 89 additions and 83 deletions

View File

@@ -65,9 +65,9 @@ extension ChannelsStore {
}
func updateConfigValue(path: ConfigPath, value: Any?) {
var root = self.configDraft
var root: Any = self.configDraft
setValue(&root, path: path, value: value)
self.configDraft = root
self.configDraft = root as? [String: Any] ?? self.configDraft
self.configDirty = true
}
@@ -125,7 +125,7 @@ private func setValue(_ root: inout Any, path: ConfigPath, value: Any?) {
case .index(let index):
var array = root as? [Any] ?? []
if index >= array.count {
array.append(contentsOf: repeatElement(NSNull(), count: index - array.count + 1))
array.append(contentsOf: repeatElement(NSNull() as Any, count: index - array.count + 1))
}
if path.count == 1 {
if let value {