fix(reports): avoid stuck loading state when session is missing
This commit is contained in:
parent
404ac270f7
commit
7e798cd7e6
1 changed files with 9 additions and 1 deletions
|
|
@ -24,7 +24,15 @@ class _MyReportsScreenState extends State<MyReportsScreen> {
|
||||||
|
|
||||||
Future<void> _loadReports() async {
|
Future<void> _loadReports() async {
|
||||||
final user = supabase.auth.currentUser;
|
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(() {
|
setState(() {
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue