Skip to content

Commit

Permalink
feat: fetch messages on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Apr 21, 2024
1 parent 9c49a1a commit 8aadece
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/sync/matrix/timeline.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:lotti/database/database.dart';
import 'package:lotti/database/logging_db.dart';
Expand Down Expand Up @@ -25,12 +27,15 @@ Future<void> listenToTimelineEvents({
service.timeline = await service.syncRoom?.getTimeline(
onNewEvent: () {
final clientRunner = service.clientRunner;
if (clientRunner.queueSize < 2) {
if (clientRunner.queueSize < 5) {
service.clientRunner.enqueueRequest(null);
}
},
);

unawaited(Future<void>.delayed(const Duration(seconds: 1))
.then((value) => service.clientRunner.enqueueRequest(null)));

final timeline = service.timeline;

if (timeline == null) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: lotti
description: Achieve your goals and keep your data private with Lotti.
publish_to: 'none'
version: 0.9.449+2465
version: 0.9.450+2467

msix_config:
display_name: LottiApp
Expand Down

0 comments on commit 8aadece

Please sign in to comment.