|
|
@ -219,18 +219,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|
|
|
void requestHistory([_]) async {
|
|
|
|
void requestHistory([_]) async {
|
|
|
|
if (!timeline!.canRequestHistory) return;
|
|
|
|
if (!timeline!.canRequestHistory) return;
|
|
|
|
Logs().v('Requesting history...');
|
|
|
|
Logs().v('Requesting history...');
|
|
|
|
try {
|
|
|
|
|
|
|
|
await timeline!.requestHistory(historyCount: _loadHistoryCount);
|
|
|
|
await timeline!.requestHistory(historyCount: _loadHistoryCount);
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
|
|
|
|
SnackBar(
|
|
|
|
|
|
|
|
content: Text(
|
|
|
|
|
|
|
|
(err).toLocalizedString(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
rethrow;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void requestFuture() async {
|
|
|
|
void requestFuture() async {
|
|
|
@ -238,20 +227,9 @@ class ChatController extends State<ChatPageWithRoom> {
|
|
|
|
if (timeline == null) return;
|
|
|
|
if (timeline == null) return;
|
|
|
|
if (!timeline.canRequestFuture) return;
|
|
|
|
if (!timeline.canRequestFuture) return;
|
|
|
|
Logs().v('Requesting future...');
|
|
|
|
Logs().v('Requesting future...');
|
|
|
|
try {
|
|
|
|
|
|
|
|
final mostRecentEventId = timeline.events.first.eventId;
|
|
|
|
final mostRecentEventId = timeline.events.first.eventId;
|
|
|
|
await timeline.requestFuture(historyCount: _loadHistoryCount);
|
|
|
|
await timeline.requestFuture(historyCount: _loadHistoryCount);
|
|
|
|
setReadMarker(eventId: mostRecentEventId);
|
|
|
|
setReadMarker(eventId: mostRecentEventId);
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
|
|
|
|
SnackBar(
|
|
|
|
|
|
|
|
content: Text(
|
|
|
|
|
|
|
|
(err).toLocalizedString(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
rethrow;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void _updateScrollController() {
|
|
|
|
void _updateScrollController() {
|
|
|
|