fix: check if context.mounted before updating usestates in chat_detail_screen.dart

This commit is contained in:
Freek van de Ven 2025-02-20 09:15:11 +01:00 committed by FlutterJoey
parent 62f04e2d9b
commit b0d379284d

View file

@ -278,6 +278,7 @@ class _ChatBody extends HookWidget {
]);
} finally {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!context.mounted) return;
if (!scrollController.hasClients) {
isLoadingOlder.value = false;
return;
@ -307,7 +308,9 @@ class _ChatBody extends HookWidget {
),
]);
} finally {
isLoadingNewer.value = false;
if (context.mounted) {
isLoadingNewer.value = false;
}
}
}