Skip to content

Commit

Permalink
fixup! fixup! TW-2165: Add ADR for this tick
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Jan 3, 2025
1 parent a8a607b commit 1f0c313
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ More details about this logic can be found in the [ADR #0005](https://github.com

1.2 **Display members in the group chat detail**
- When the user clicks on the group chat, how to display the members?
1. Display members with a maximum size defined by the `_maxMembers` variable defined in `chat_details_tab_mixin.dart`.
1. Display members with a maximum size defined by the `_membersPerPage` variable defined in `chat_details_tab_mixin.dart`.
```dart
static const _maxMembers = 30;
static const _membersPerPage = 30;
```
2. If more members can be loaded, display the Load more button at the end of the list.
3. When the user clicks on the Load more button, call the function to get more members from the Hive database.
```dart
void _requestMoreMembersAction() async {
final currentMembersCount = _displayMembersNotifier.value?.length ?? 0;
_currentMembersCount += _maxMembers;
_currentMembersCount += _membersPerPage;
final members = _membersNotifier.value;
if (members != null && currentMembersCount < members.length) {
Expand Down
6 changes: 3 additions & 3 deletions lib/presentation/mixins/chat_details_tab_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ mixin ChatDetailsTabMixin<T extends StatefulWidget>
static const _mediaFetchLimit = 20;
static const _linksFetchLimit = 20;
static const _filesFetchLimit = 20;
static const _maxMembers = 30;
int _currentMembersCount = _maxMembers;
static const _membersPerPage = 30;
int _currentMembersCount = _membersPerPage;

static const _memberPageKey = PageStorageKey('members');
static const _mediaPageKey = PageStorageKey('media');
Expand Down Expand Up @@ -114,7 +114,7 @@ mixin ChatDetailsTabMixin<T extends StatefulWidget>

void _requestMoreMembersAction() async {
final currentMembersCount = _displayMembersNotifier.value?.length ?? 0;
_currentMembersCount += _maxMembers;
_currentMembersCount += _membersPerPage;

final members = _membersNotifier.value;
if (members != null && currentMembersCount < members.length) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ packages:
description:
path: "."
ref: TW-2165-support-store-members-in-local-database
resolved-ref: "878b5e873c5196ae0207db762a3253f66a4c337b"
resolved-ref: "5db9aac805dc165508ee10abfe06a4489b98f26a"
url: "[email protected]:linagora/matrix-dart-sdk.git"
source: git
version: "0.22.6"
Expand Down

0 comments on commit 1f0c313

Please sign in to comment.