File tree 2 files changed +10
-5
lines changed
app/src/main/java/com/nextcloud/talk/chat
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -828,12 +828,15 @@ class ChatActivity :
828
828
// Handle UI on first load
829
829
cancelNotificationsForCurrentConversation()
830
830
binding.progressBar.visibility = View .GONE
831
+ binding.offline.root.visibility = View .GONE
831
832
binding.messagesListView.visibility = View .VISIBLE
832
833
collapseSystemMessages()
833
834
}
834
835
835
836
is ChatViewModel .ChatMessageUpdateState -> {
836
- // unused atm
837
+ binding.progressBar.visibility = View .GONE
838
+ binding.offline.root.visibility = View .GONE
839
+ binding.messagesListView.visibility = View .VISIBLE
837
840
}
838
841
839
842
is ChatViewModel .ChatMessageErrorState -> {
@@ -918,9 +921,9 @@ class ChatActivity :
918
921
chatViewModel.getGeneralUIFlow.onEach { key ->
919
922
when (key) {
920
923
NO_OFFLINE_MESSAGES_FOUND -> {
921
- if (networkMonitor.isOnline.value. not ()) {
922
- binding.offline.root. visibility = View .VISIBLE
923
- }
924
+ binding.progressBar.visibility = View . GONE
925
+ binding.messagesListView. visibility = View .GONE
926
+ binding.offline.root.visibility = View . VISIBLE
924
927
}
925
928
926
929
else -> {}
Original file line number Diff line number Diff line change @@ -157,7 +157,9 @@ class OfflineFirstChatRepository @Inject constructor(
157
157
} else {
158
158
if (! weAlreadyHaveSomeOfflineMessages) {
159
159
Log .d(TAG , " An online request for newest 100 messages is made because offline chat is empty" )
160
- _generalUIFlow .emit(ChatActivity .NO_OFFLINE_MESSAGES_FOUND )
160
+ if (networkMonitor.isOnline.value.not ()) {
161
+ _generalUIFlow .emit(ChatActivity .NO_OFFLINE_MESSAGES_FOUND )
162
+ }
161
163
} else {
162
164
Log .d(
163
165
TAG ,
You can’t perform that action at this time.
0 commit comments