|
@@ -616,6 +616,7 @@ class ConversationsListController(bundle: Bundle) :
|
|
handleHttpExceptions(throwable)
|
|
handleHttpExceptions(throwable)
|
|
withNullableControllerViewBinding {
|
|
withNullableControllerViewBinding {
|
|
binding.swipeRefreshLayoutView.isRefreshing = false
|
|
binding.swipeRefreshLayoutView.isRefreshing = false
|
|
|
|
+ showErrorDialog()
|
|
}
|
|
}
|
|
dispose(roomsQueryDisposable)
|
|
dispose(roomsQueryDisposable)
|
|
}) {
|
|
}) {
|
|
@@ -627,6 +628,24 @@ class ConversationsListController(bundle: Bundle) :
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private fun showErrorDialog() {
|
|
|
|
+ val dialogBuilder = MaterialAlertDialogBuilder(binding.floatingActionButton.context)
|
|
|
|
+ .setIcon(
|
|
|
|
+ viewThemeUtils.dialog.colorMaterialAlertDialogIcon(
|
|
|
|
+ context,
|
|
|
|
+ R.drawable.ic_baseline_error_outline_24dp,
|
|
|
|
+ )
|
|
|
|
+ )
|
|
|
|
+ .setTitle(R.string.error_loading_chats)
|
|
|
|
+ .setCancelable(false)
|
|
|
|
+ .setNegativeButton(R.string.close, null)
|
|
|
|
+ viewThemeUtils.dialog.colorMaterialAlertDialogBackground(binding.floatingActionButton.context, dialogBuilder)
|
|
|
|
+ val dialog = dialogBuilder.show()
|
|
|
|
+ viewThemeUtils.platform.colorTextButtons(
|
|
|
|
+ dialog.getButton(AlertDialog.BUTTON_NEGATIVE)
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
private fun sortConversations(conversationItems: MutableList<AbstractFlexibleItem<*>>) {
|
|
private fun sortConversations(conversationItems: MutableList<AbstractFlexibleItem<*>>) {
|
|
conversationItems.sortWith { o1: AbstractFlexibleItem<*>, o2: AbstractFlexibleItem<*> ->
|
|
conversationItems.sortWith { o1: AbstractFlexibleItem<*>, o2: AbstractFlexibleItem<*> ->
|
|
val conversation1 = (o1 as ConversationItem).model
|
|
val conversation1 = (o1 as ConversationItem).model
|
|
@@ -1344,6 +1363,7 @@ class ConversationsListController(bundle: Bundle) :
|
|
handleHttpExceptions(throwable)
|
|
handleHttpExceptions(throwable)
|
|
withNullableControllerViewBinding {
|
|
withNullableControllerViewBinding {
|
|
binding.swipeRefreshLayoutView.isRefreshing = false
|
|
binding.swipeRefreshLayoutView.isRefreshing = false
|
|
|
|
+ showErrorDialog()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|