Skip to content

Commit

Permalink
hot-fix: members list always have to reload
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn committed May 29, 2024
1 parent 3d348cd commit 10e10c5
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions lib/pages/chat_details/chat_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ class ChatDetailsController extends State<ChatDetails>
@override
void initState() {
super.initState();
initControllers();
WidgetsBinding.instance.addPostFrameCallback((_) {
nestedScrollViewState.currentState?.innerController.addListener(
_listenerInnerController,
);
_refreshDataInTabviewInit();
});
initValueNotifiers();
_listenForRoomMembersChanged();
}

void initControllers() {
tabController = TabController(
length: chatDetailsPageView.length,
vsync: this,
Expand All @@ -139,15 +151,12 @@ class ChatDetailsController extends State<ChatDetails>
searchFunc: (event) => event.isAFile,
limit: _filesFetchLimit,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
nestedScrollViewState.currentState?.innerController.addListener(
_listenerInnerController,
);
_refreshDataInTabviewInit();
});
}

void initValueNotifiers() {
room = Matrix.of(context).client.getRoomById(roomId!);
muteNotifier.value = room?.pushRuleState ?? PushRuleState.notify;
_listenForRoomMembersChanged();
membersNotifier.value ??= room?.getParticipants();
}

void _listenForRoomMembersChanged() {
Expand All @@ -163,6 +172,7 @@ class ChatDetailsController extends State<ChatDetails>
void dispose() {
tabController?.dispose();
muteNotifier.dispose();
membersNotifier.dispose();
mediaListController?.dispose();
linksListController?.dispose();
filesListController?.dispose();
Expand Down

0 comments on commit 10e10c5

Please sign in to comment.