Generate "is typing" string only if someone is typing

If no user is typing (currentRoom.userseTyping.length == 0) then don't
generate the "is typing" string. Because the message box is invisible.

This prefents error messages like:
```
kf.i18n: "1 instead of 2 arguments to message {%2 are typing} supplied before conversion."
```

Fixes: https://invent.kde.org/network/neochat/-/issues/80
This commit is contained in:
Reinhold Gschweicher
2020-11-27 12:47:36 +01:00
committed by Carl Schwan
parent 7140734576
commit 244adf3467

View File

@@ -358,7 +358,7 @@ Kirigami.ScrollablePage {
Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
}
QQC2.Label {
text: i18ncp("Message displayed when some users are typing", "%2 is typing", "%2 are typing", currentRoom.usersTyping.length, currentRoom.usersTyping.map(user => user.displayName).join(", "))
text: visible ? i18ncp("Message displayed when some users are typing", "%2 is typing", "%2 are typing", currentRoom.usersTyping.length, currentRoom.usersTyping.map(user => user.displayName).join(", ")) : ""
}
}