krz/hutch
an ios client for sourcehut
clone: git clone https://gitbay.org/krz/hutch.git
7ffef07278e94bd3c268ee5cbd5c9c11cbfa3270
verified · cmc
author: Christian Cleberg <hello@cleberg.net> · 2026-07-16T00:25:27Z
Hutch/Views/Repositories/RepositorySettingsViewModel.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) @@ -301,7 +301,14 @@ final class RepositorySettingsViewModel { } if normalizedEditedDescription != (repository.description ?? "") { - input["description"] = normalizedEditedDescription.isEmpty ? Optional<String>.none as String? : normalizedEditedDescription + if normalizedEditedDescription.isEmpty { + // Assigning nil through the subscript would remove the key and omit + // `description` from the mutation, leaving the old value in place. + // updateValue stores an explicit nil, which AnyCodable encodes as null. + input.updateValue(Optional<String>.none as any Sendable, forKey: "description") + } else { + input["description"] = normalizedEditedDescription + } } return input