mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 23:12:37 +01:00
fix: Don't show loading dialog on request history
This commit is contained in:
parent
e2791de69b
commit
e4b6e1035e
@ -11,6 +11,7 @@ import 'package:fluffychat/components/avatar.dart';
|
|||||||
import 'package:fluffychat/components/chat_settings_popup_menu.dart';
|
import 'package:fluffychat/components/chat_settings_popup_menu.dart';
|
||||||
import 'package:fluffychat/components/connection_status_header.dart';
|
import 'package:fluffychat/components/connection_status_header.dart';
|
||||||
import 'package:fluffychat/components/dialogs/recording_dialog.dart';
|
import 'package:fluffychat/components/dialogs/recording_dialog.dart';
|
||||||
|
import 'package:flushbar/flushbar_helper.dart';
|
||||||
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
import 'package:future_loading_dialog/future_loading_dialog.dart';
|
||||||
import 'package:fluffychat/components/encryption_button.dart';
|
import 'package:fluffychat/components/encryption_button.dart';
|
||||||
import 'package:fluffychat/components/list_items/message.dart';
|
import 'package:fluffychat/components/list_items/message.dart';
|
||||||
@ -114,10 +115,13 @@ class _ChatState extends State<_Chat> {
|
|||||||
if (_canLoadMore) {
|
if (_canLoadMore) {
|
||||||
setState(() => _loadingHistory = true);
|
setState(() => _loadingHistory = true);
|
||||||
|
|
||||||
await showFutureLoadingDialog(
|
try {
|
||||||
context: context,
|
await timeline.requestHistory(historyCount: _loadHistoryCount);
|
||||||
future: () => timeline.requestHistory(historyCount: _loadHistoryCount),
|
} catch (err) {
|
||||||
);
|
await FlushbarHelper.createError(
|
||||||
|
message: err.toLocalizedString(context))
|
||||||
|
.show(context);
|
||||||
|
}
|
||||||
|
|
||||||
// we do NOT setState() here as then the event order will be wrong.
|
// 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
|
// instead, we just set our variable to false, and rely on timeline update to set the
|
||||||
|
Loading…
Reference in New Issue
Block a user