replies: fix bug where it would sometimes show -1

Changelog-Fixed: Fix bug where it would sometimes show -1 in replies
Closes: https://github.com/damus-io/damus/pull/1476
This commit is contained in:
tappu75e@duck.com
2023-08-14 22:22:31 +03:00
committed by William Casarin
parent 066b3cdde8
commit f9eb669132

View File

@@ -47,7 +47,7 @@ func reply_desc(profiles: Profiles, event: NostrEvent, replying_to: NostrEvent?,
if uniqueNames.count > 1 {
let othersCount = n - pubkeys.count
if othersCount == 0 {
if othersCount <= 0 {
return String(format: NSLocalizedString("Replying to %@ & %@", bundle: bundle, comment: "Label to indicate that the user is replying to 2 users."), locale: locale, uniqueNames[0], uniqueNames[1])
} else {
return String(format: localizedStringFormat(key: "replying_to_two_and_others", locale: locale), locale: locale, othersCount, uniqueNames[0], uniqueNames[1])