mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-24 15:05:22 -04:00
statenotifier
This commit is contained in:
parent
8f0b4aaba0
commit
7a49497620
15 changed files with 28 additions and 56 deletions
|
@ -31,7 +31,7 @@ class HomePage extends ConsumerStatefulWidget {
|
|||
final contactList = ref.watch(fetchContactListProvider).asData?.value ??
|
||||
const IListConst([]);
|
||||
|
||||
final activeChat = ref.watch(activeChatStateProvider).asData?.value;
|
||||
final activeChat = ref.watch(activeChatStateProvider);
|
||||
if (activeChat == null) {
|
||||
return const EmptyChatWidget();
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class HomePage extends ConsumerStatefulWidget {
|
|||
activeChat,
|
||||
);
|
||||
if (activeChatContactIdx == -1) {
|
||||
activeChatState.add(null);
|
||||
ref.read(activeChatStateProvider.notifier).state = null;
|
||||
return const EmptyChatWidget();
|
||||
}
|
||||
final activeChatContact = contactList[activeChatContactIdx];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue