diff --git a/filcnaplo/lib/models/ad.dart b/filcnaplo/lib/models/ad.dart index dcc4b0c..09eba03 100644 --- a/filcnaplo/lib/models/ad.dart +++ b/filcnaplo/lib/models/ad.dart @@ -20,7 +20,6 @@ class Ad { }); factory Ad.fromJson(Map json) { - print(json); return Ad( title: json['title'] ?? 'Ad', description: json['description'] ?? '', diff --git a/filcnaplo_kreta_api/lib/client/client.dart b/filcnaplo_kreta_api/lib/client/client.dart index f150e3b..7f1f42a 100644 --- a/filcnaplo_kreta_api/lib/client/client.dart +++ b/filcnaplo_kreta_api/lib/client/client.dart @@ -26,6 +26,8 @@ class KretaClient { late final UserProvider _user; late final StatusProvider _status; + bool _loginRefreshing = false; + KretaClient({ this.accessToken, required SettingsProvider settings, @@ -164,6 +166,9 @@ class KretaClient { } Future refreshLogin() async { + if (_loginRefreshing) return; + _loginRefreshing = true; + User? loginUser = _user.user; if (loginUser == null) return; @@ -215,5 +220,7 @@ class KretaClient { } } } + + _loginRefreshing = false; } } diff --git a/filcnaplo_kreta_api/lib/providers/timetable_provider.dart b/filcnaplo_kreta_api/lib/providers/timetable_provider.dart index 1b9a3ef..b7d235f 100644 --- a/filcnaplo_kreta_api/lib/providers/timetable_provider.dart +++ b/filcnaplo_kreta_api/lib/providers/timetable_provider.dart @@ -5,7 +5,7 @@ import 'package:filcnaplo_kreta_api/client/api.dart'; import 'package:filcnaplo_kreta_api/client/client.dart'; import 'package:filcnaplo_kreta_api/models/lesson.dart'; import 'package:filcnaplo_kreta_api/models/week.dart'; -import 'package:flutter/material.dart'; +import 'package:flutter/foundation.dart'; class TimetableProvider with ChangeNotifier { Map> lessons = {}; @@ -69,14 +69,14 @@ class TimetableProvider with ChangeNotifier { .getAPI(KretaAPI.timetable(iss, start: week.start, end: week.end)); if (lessonsJson == null) { + if (kDebugMode) print('Cannot fetch Lessons for User ${user.id}'); + return; // throw "Cannot fetch Lessons for User ${user.id}"; } else { List lessonsList = lessonsJson.map((e) => Lesson.fromJson(e)).toList(); - if (lessons.isEmpty) return; - lessons[week] = lessonsList; await store(); diff --git a/filcnaplo_mobile_ui/lib/common/widgets/ad/ad_tile.dart b/filcnaplo_mobile_ui/lib/common/widgets/ad/ad_tile.dart index 12add1b..e9c0fde 100644 --- a/filcnaplo_mobile_ui/lib/common/widgets/ad/ad_tile.dart +++ b/filcnaplo_mobile_ui/lib/common/widgets/ad/ad_tile.dart @@ -13,9 +13,6 @@ class AdTile extends StatelessWidget { @override Widget build(BuildContext context) { - print('geic'); - print(ad); - return Padding( padding: padding ?? const EdgeInsets.symmetric(horizontal: 8.0), child: PanelButton(