fix(reports): avoid stuck loading state when session is missing

This commit is contained in:
Lukas Müllner 2026-03-05 14:46:42 +01:00
parent 404ac270f7
commit 7e798cd7e6

View file

@ -24,7 +24,15 @@ class _MyReportsScreenState extends State<MyReportsScreen> {
Future<void> _loadReports() async {
final user = supabase.auth.currentUser;
if (user == null) return;
if (user == null) {
if (!mounted) return;
setState(() {
_reports = [];
_error = 'Please sign in to view reports.';
_isLoading = false;
});
return;
}
setState(() {
_isLoading = true;