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) { private fun modifyMessageCount(shouldAddNewMessagesNotice: Boolean, shouldScroll: Boolean) {
if (!shouldAddNewMessagesNotice && !shouldScroll) { if (!shouldAddNewMessagesNotice && !shouldScroll) {
if (!binding?.popupBubbleView?.isShown!!) { binding?.popupBubbleView?.isShown?.let {
newMessagesCount = 1 if (it) {
binding?.scrollDownButton?.visibility = View.GONE newMessagesCount++
binding?.popupBubbleView?.show() } else {
} else if (binding?.popupBubbleView?.isShown!!) { newMessagesCount = 1
newMessagesCount++ binding?.scrollDownButton?.visibility = View.GONE
binding?.popupBubbleView?.show()
}
} }
} else { } else {
binding?.scrollDownButton?.visibility = View.GONE
newMessagesCount = 0 newMessagesCount = 0
} }
} }