mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-22 13:32:37 +01:00
chore: Make connection header less chatty
This commit is contained in:
parent
9bc5913651
commit
b90c5d4383
@ -17,7 +17,7 @@ class _ConnectionStatusHeaderState extends State<ConnectionStatusHeader> {
|
|||||||
bool get _connected =>
|
bool get _connected =>
|
||||||
DateTime.now().millisecondsSinceEpoch -
|
DateTime.now().millisecondsSinceEpoch -
|
||||||
_lastSyncReceived.millisecondsSinceEpoch <
|
_lastSyncReceived.millisecondsSinceEpoch <
|
||||||
1000 * 30;
|
(Matrix.of(context).client.syncTimeoutSec + 2) * 1000;
|
||||||
static DateTime _lastSyncReceived = DateTime(0);
|
static DateTime _lastSyncReceived = DateTime(0);
|
||||||
SyncStatusUpdate _status = SyncStatusUpdate(SyncStatus.waitingForResponse);
|
SyncStatusUpdate _status = SyncStatusUpdate(SyncStatus.waitingForResponse);
|
||||||
|
|
||||||
@ -33,7 +33,9 @@ class _ConnectionStatusHeaderState extends State<ConnectionStatusHeader> {
|
|||||||
_onSyncSub ??= Matrix.of(context).client.onSyncStatus.stream.listen(
|
_onSyncSub ??= Matrix.of(context).client.onSyncStatus.stream.listen(
|
||||||
(status) => setState(
|
(status) => setState(
|
||||||
() {
|
() {
|
||||||
if (status.status == SyncStatus.finished) {
|
if ((status.status == SyncStatus.processing &&
|
||||||
|
Matrix.of(context).client.prevBatch != null) ||
|
||||||
|
status.status == SyncStatus.finished) {
|
||||||
_lastSyncReceived = DateTime.now();
|
_lastSyncReceived = DateTime.now();
|
||||||
}
|
}
|
||||||
_status = status;
|
_status = status;
|
||||||
|
Loading…
Reference in New Issue
Block a user