Commit 2d5bac75e0
Unsigned
Layout: unified · split
Hutch/Views/Repositories/RepositorySettingsViewModel.swift +8 −1
| @@ -301,7 +301,14 @@ final class RepositorySettingsViewModel { | ||
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | if normalizedEditedDescription != (repository.description ?? "") { |
| 304 | input["description"] = normalizedEditedDescription.isEmpty ? Optional<String>.none as String? : normalizedEditedDescription | |
| 304 | if normalizedEditedDescription.isEmpty { | |
| 305 | // Assigning nil through the subscript would remove the key and omit | |
| 306 | // `description` from the mutation, leaving the old value in place. | |
| 307 | // updateValue stores an explicit nil, which AnyCodable encodes as null. | |
| 308 | input.updateValue(Optional<String>.none as any Sendable, forKey: "description") | |
| 309 | } else { | |
| 310 | input["description"] = normalizedEditedDescription | |
| 311 | } | |
| 305 | 312 | } |
| 306 | 313 | |
| 307 | 314 | return input |