Merge pull request #2800 from nextcloud/bugfix/noid/avoidNpeForUnreadBubble

Bugfix/noid/avoid npe for unread bubble
This commit is contained in:
Andy Scherzinger 2023-02-27 16:44:25 +01:00 committed by GitHub
commit f1fd334b64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2533,14 +2533,17 @@ class ChatController(args: Bundle) :
private fun modifyMessageCount(shouldAddNewMessagesNotice: Boolean, shouldScroll: Boolean) {
if (!shouldAddNewMessagesNotice && !shouldScroll) {
if (!binding?.popupBubbleView?.isShown!!) {
newMessagesCount = 1
binding?.scrollDownButton?.visibility = View.GONE
binding?.popupBubbleView?.show()
} else if (binding?.popupBubbleView?.isShown!!) {
newMessagesCount++
binding?.popupBubbleView?.isShown?.let {
if (it) {
newMessagesCount++
} else {
newMessagesCount = 1
binding?.scrollDownButton?.visibility = View.GONE
binding?.popupBubbleView?.show()
}
}
} else {
binding?.scrollDownButton?.visibility = View.GONE
newMessagesCount = 0
}
}