diff --git a/uni/lib/model/providers/startup/session_provider.dart b/uni/lib/model/providers/startup/session_provider.dart index 3a91f5a15..96644a1be 100644 --- a/uni/lib/model/providers/startup/session_provider.dart +++ b/uni/lib/model/providers/startup/session_provider.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:collection'; import 'package:uni/controller/background_workers/notifications.dart'; import 'package:uni/controller/load_static/terms_and_conditions.dart'; @@ -14,7 +13,6 @@ import 'package:uni/model/request_status.dart'; class SessionProvider extends StateProviderNotifier { late Session _session; - late List _faculties; SessionProvider() : super( @@ -24,9 +22,6 @@ class SessionProvider extends StateProviderNotifier { Session get session => _session; - UnmodifiableListView get faculties => - UnmodifiableListView(_faculties); - @override Future loadFromStorage() async {} @@ -46,8 +41,6 @@ class SessionProvider extends StateProviderNotifier { Future postAuthentication(String username, String password, List faculties, persistentSession) async { - _faculties = faculties; - updateStatus(RequestStatus.busy); Session? session; diff --git a/uni/lib/view/home/widgets/main_cards_list.dart b/uni/lib/view/home/widgets/main_cards_list.dart index 7871c81d7..72656370f 100644 --- a/uni/lib/view/home/widgets/main_cards_list.dart +++ b/uni/lib/view/home/widgets/main_cards_list.dart @@ -103,12 +103,13 @@ class MainCardsList extends StatelessWidget { } List getCardAdders(BuildContext context) { - final userSession = Provider.of(context, listen: false); + final session = + Provider.of(context, listen: false).session; final List favorites = Provider.of(context, listen: false).favoriteCards; final possibleCardAdditions = cardCreators.entries - .where((e) => e.key.isVisible(userSession.faculties)) + .where((e) => e.key.isVisible(session.faculties)) .where((e) => !favorites.contains(e.key)) .map((e) => Container( decoration: const BoxDecoration(),