loading state and error handling refactor
This commit is contained in:
@@ -12,6 +12,7 @@ import '../../../state/app/modules/chatList/bloc/chat_list_state.dart';
|
||||
import '../../../notification/notify_updater.dart';
|
||||
import '../../../state/app/modules/settings/bloc/settings_cubit.dart';
|
||||
import '../../../widget/confirm_dialog.dart';
|
||||
import '../../../widget/placeholder_view.dart';
|
||||
import 'widgets/chat_tile.dart';
|
||||
import 'widgets/split_view_placeholder.dart';
|
||||
import 'join_chat.dart';
|
||||
@@ -144,9 +145,7 @@ class _ChatListViewState extends State<_ChatListView> {
|
||||
title: 'Chat starten',
|
||||
content: "Möchtest du einen Chat mit Nutzer '$username' starten?",
|
||||
confirmButton: 'Chat starten',
|
||||
onConfirm: () {
|
||||
bloc.createDirectChat(username);
|
||||
},
|
||||
onConfirmAsync: () => bloc.createDirectChat(username),
|
||||
).asDialog(context);
|
||||
});
|
||||
},
|
||||
@@ -164,6 +163,13 @@ class _ChatListViewState extends State<_ChatListView> {
|
||||
unreadToTop: talkSettings.sortUnreadToTop,
|
||||
);
|
||||
|
||||
if (sorted.isEmpty) {
|
||||
return const PlaceholderView(
|
||||
icon: Icons.chat_bubble_outline,
|
||||
text: 'Noch keine Chats — starte einen über das +-Symbol.',
|
||||
);
|
||||
}
|
||||
|
||||
return ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: sorted.map((room) {
|
||||
|
||||
Reference in New Issue
Block a user