mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-09 07:29:52 +00:00
Merge pull request #4645 from nextcloud/bugfix/4643/fixShimmerAndOfflineNoMessagesInfo
fix shimmer and "offlineNoMessages"-info handling
This commit is contained in:
commit
4c6c08be55
@ -828,12 +828,15 @@ class ChatActivity :
|
||||
// Handle UI on first load
|
||||
cancelNotificationsForCurrentConversation()
|
||||
binding.progressBar.visibility = View.GONE
|
||||
binding.offline.root.visibility = View.GONE
|
||||
binding.messagesListView.visibility = View.VISIBLE
|
||||
collapseSystemMessages()
|
||||
}
|
||||
|
||||
is ChatViewModel.ChatMessageUpdateState -> {
|
||||
// unused atm
|
||||
binding.progressBar.visibility = View.GONE
|
||||
binding.offline.root.visibility = View.GONE
|
||||
binding.messagesListView.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
is ChatViewModel.ChatMessageErrorState -> {
|
||||
@ -918,10 +921,10 @@ class ChatActivity :
|
||||
chatViewModel.getGeneralUIFlow.onEach { key ->
|
||||
when (key) {
|
||||
NO_OFFLINE_MESSAGES_FOUND -> {
|
||||
if (networkMonitor.isOnline.value.not()) {
|
||||
binding.progressBar.visibility = View.GONE
|
||||
binding.messagesListView.visibility = View.GONE
|
||||
binding.offline.root.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
|
@ -157,7 +157,9 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
} else {
|
||||
if (!weAlreadyHaveSomeOfflineMessages) {
|
||||
Log.d(TAG, "An online request for newest 100 messages is made because offline chat is empty")
|
||||
if (networkMonitor.isOnline.value.not()) {
|
||||
_generalUIFlow.emit(ChatActivity.NO_OFFLINE_MESSAGES_FOUND)
|
||||
}
|
||||
} else {
|
||||
Log.d(
|
||||
TAG,
|
||||
|
Loading…
Reference in New Issue
Block a user