Skip to content

Commit

Permalink
TW-1862: Fix can't display message in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Oct 21, 2024
1 parent 342dec8 commit 3054596
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
15 changes: 13 additions & 2 deletions lib/pages/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,14 @@ class ChatController extends State<Chat>

Future<void> requestHistory({
int? historyCount,
StateFilter? filter,
}) async {
if (!timeline!.canRequestHistory) return;
Logs().v('Chat::requestHistory(): Requesting history...');
try {
return timeline!.requestHistory(
historyCount: historyCount ?? _loadHistoryCount,
filter: filter,
);
} catch (err) {
ScaffoldMessenger.of(context).showSnackBar(
Expand Down Expand Up @@ -1748,10 +1750,19 @@ class ChatController extends State<Chat>
if (allMembershipEvents || canRequestHistory) {
try {
await requestHistory(historyCount: _defaultEventCountDisplay)
.then((response) {
Logs().d(
.then((response) async {
Logs().v(
'Chat::_tryRequestHistory():: Try request history success',
);
if (allMembershipEvents) {
await requestHistory(
historyCount: _defaultEventCountDisplay,
filter: StateFilter(
lazyLoadMembers: true,
types: [EventTypes.Message],
),
);
}
});
} catch (e) {
Logs().e(
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1875,8 +1875,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "twake-supported-0.22.6"
resolved-ref: "8435e632d7bce166085c6426fbfb4173457526f9"
ref: support-filter-for-request-history
resolved-ref: "420ed04a43f14b15aec6dda50fdad9d23b39414d"
url: "[email protected]:linagora/matrix-dart-sdk.git"
source: git
version: "0.22.6"
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
matrix:
git:
url: [email protected]:linagora/matrix-dart-sdk.git
ref: twake-supported-0.22.6
ref: support-filter-for-request-history

receive_sharing_intent:
git:
Expand Down

0 comments on commit 3054596

Please sign in to comment.