Fix chatters list not updating when appearing
This commit is contained in:
parent
6ca67ea39f
commit
a03084af1c
2 changed files with 5 additions and 7 deletions
|
|
@ -165,14 +165,10 @@ abstract class _ChatStoreBase with Store {
|
|||
_channel?.sink.add('PONG :tmi.twitch.tv');
|
||||
return;
|
||||
} else if (message.contains('Welcome, GLHF!')) {
|
||||
_messages.add(IRCMessage.createNotice(message: "Connected to $channelName's chat."));
|
||||
|
||||
// Fetch the users in chat.
|
||||
chatDetailsStore.updateChatters(channelName);
|
||||
_messages.add(IRCMessage.createNotice(message: "Connected to $channelName's chat"));
|
||||
|
||||
// Fetch the assets used in chat including badges and emotes.
|
||||
_messages.add(IRCMessage.createNotice(message: 'Fetching badges and emotes...'));
|
||||
|
||||
assetsStore
|
||||
.getAssets(channelName: channelName, headers: auth.headersTwitch)
|
||||
.then((_) => _messages.add(IRCMessage.createNotice(message: 'Badges and emotes fetched!')))
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'package:collection/collection.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
import 'package:frosty/screens/channel/chat/details/chat_details_store.dart';
|
||||
import 'package:frosty/widgets/loading_indicator.dart';
|
||||
import 'package:frosty/widgets/scroll_to_top_button.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
|
|
@ -50,9 +51,10 @@ class _ChattersListState extends State<ChattersList> {
|
|||
];
|
||||
|
||||
final chatDetailStore = widget.chatDetails;
|
||||
chatDetailStore.updateChatters(widget.userLogin);
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
onTap: FocusManager.instance.primaryFocus?.unfocus,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
|
|
@ -89,7 +91,7 @@ class _ChattersListState extends State<ChattersList> {
|
|||
Observer(
|
||||
builder: (context) {
|
||||
if (chatDetailStore.chatUsers == null) {
|
||||
return const Center(child: Text('Failed to get chatters :('));
|
||||
return const LoadingIndicator(subtitle: Text('Fetching chatters...'));
|
||||
}
|
||||
|
||||
return CustomScrollView(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue