diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 7ac4a0c9..a99ed2a7 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -1609,7 +1609,7 @@ "type": "text", "placeholders": {} }, - "startYourFirstChat": "Start your first chat right now! 🙂\n- Tap on "+"\n- Enter the username of a friend\n- Have fun chatting", + "startYourFirstChat": "Start your first chat right now! 🙂\n- Tap on \"+\"\n- Enter the username of a friend\n- Have fun chatting", "@startYourFirstChat": { "type": "text", "placeholders": {} diff --git a/lib/views/chat.dart b/lib/views/chat.dart index d6b6cc91..9080a0b6 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -81,8 +81,6 @@ class _ChatState extends State { bool get selectMode => selectedEvents.isNotEmpty; - bool _loadingHistory = false; - final int _loadHistoryCount = 100; String inputText = ''; @@ -93,8 +91,6 @@ class _ChatState extends State { void requestHistory() async { if (_canLoadMore) { - setState(() => _loadingHistory = true); - try { await timeline.requestHistory(historyCount: _loadHistoryCount); } catch (err) { @@ -102,11 +98,6 @@ class _ChatState extends State { message: err.toLocalizedString(context)) .show(context); } - - // we do NOT setState() here as then the event order will be wrong. - // instead, we just set our variable to false, and rely on timeline update to set the - // new state, thus triggering a re-render, for us - _loadingHistory = false; } } @@ -633,7 +624,7 @@ class _ChatState extends State { childrenDelegate: SliverChildBuilderDelegate( (BuildContext context, int i) { return i == filteredEvents.length + 1 - ? _loadingHistory + ? timeline.isRequestingHistory ? Container( height: 50, alignment: Alignment.center, diff --git a/pubspec.lock b/pubspec.lock index 37e2e02e..ff99b519 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -216,7 +216,7 @@ packages: description: path: "." ref: main - resolved-ref: "0c89098b7a3231680d87cd79e1494d326a41574e" + resolved-ref: "4597ea344553e78a0817d7cdad16ac72079c8034" url: "https://gitlab.com/famedly/famedlysdk.git" source: git version: "0.0.1"