move get replies logic to didupdatewidget
This commit is contained in:
@@ -178,10 +178,10 @@ class MessageListCoreState extends State<MessageListCore> {
|
|||||||
final newStreamChannel = StreamChannel.of(context);
|
final newStreamChannel = StreamChannel.of(context);
|
||||||
|
|
||||||
if (newStreamChannel != _streamChannel) {
|
if (newStreamChannel != _streamChannel) {
|
||||||
_streamChannel = newStreamChannel;
|
if (_streamChannel == null /*only first time*/ && _isThreadConversation) {
|
||||||
if (_isThreadConversation) {
|
|
||||||
_streamChannel!.getReplies(widget.parentMessage!.id);
|
_streamChannel!.getReplies(widget.parentMessage!.id);
|
||||||
}
|
}
|
||||||
|
_streamChannel = newStreamChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
@@ -194,6 +194,12 @@ class MessageListCoreState extends State<MessageListCore> {
|
|||||||
if (widget.messageListController != oldWidget.messageListController) {
|
if (widget.messageListController != oldWidget.messageListController) {
|
||||||
_setupController();
|
_setupController();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (widget.parentMessage?.id != widget.parentMessage?.id) {
|
||||||
|
if (_isThreadConversation) {
|
||||||
|
_streamChannel!.getReplies(widget.parentMessage!.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user