diff --git a/lib/config/ttl_config.dart b/lib/config/ttl_config.dart index 482809ce..c15b4cb6 100644 --- a/lib/config/ttl_config.dart +++ b/lib/config/ttl_config.dart @@ -7,7 +7,6 @@ part "ttl_config.g.dart"; enum TtlKey { /// We need unique key for every data source for its ttl tracking academicCalendarRepository, - newsRepository, scienceClubsRepository, scienceClubDetailsRepository, tagsRepository, @@ -15,7 +14,8 @@ enum TtlKey { departmentDetailsRepository, aboutUsRepository, buildingsRepository, - guideDetailsRepository + guideDetailsRepository, + guideViewRepository // ... add a new key here if you create a new repository } @@ -27,7 +27,6 @@ abstract class TtlStrategy { static const _ttlDurations = UnmodifiableTtlKeyMap( // TODO(simon-the-shark): specific values are yet ment to be accordingly adjusted. - newsRepository: day, academicCalendarRepository: day, scienceClubDetailsRepository: thirtyDays, scienceClubsRepository: thirtyDays, @@ -37,6 +36,7 @@ abstract class TtlStrategy { aboutUsRepository: thirtyDays, departmentDetailsRepository: thirtyDays, guideDetailsRepository: thirtyDays, + guideViewRepository: thirtyDays, ); static Duration get(TtlKey key) { diff --git a/lib/features/guide_view/repository/guide_view_repository.dart b/lib/features/guide_view/repository/guide_view_repository.dart index 2f2c0bfb..bf5fa3d9 100644 --- a/lib/features/guide_view/repository/guide_view_repository.dart +++ b/lib/features/guide_view/repository/guide_view_repository.dart @@ -15,7 +15,7 @@ Stream?> guidePostsRepository( ) async* { final stream = ref.watchQueryWithCache( _GetGuidePosts(eagerlyFetchResults: true), - TtlKey.guideDetailsRepository, + TtlKey.guideViewRepository, ); yield* stream.map((event) => event?.FAQ_Types); } diff --git a/lib/features/home_view/repositories/news/getNews.graphql b/lib/features/home_view/repositories/news/getNews.graphql deleted file mode 100644 index 42d9ee1f..00000000 --- a/lib/features/home_view/repositories/news/getNews.graphql +++ /dev/null @@ -1,10 +0,0 @@ -query GetNews { - Posts { - content - title - cover { - filename_disk - } - date_created - } -} diff --git a/lib/features/home_view/repositories/news/news_repository.dart b/lib/features/home_view/repositories/news/news_repository.dart deleted file mode 100644 index 5916512e..00000000 --- a/lib/features/home_view/repositories/news/news_repository.dart +++ /dev/null @@ -1,18 +0,0 @@ -import "package:riverpod_annotation/riverpod_annotation.dart"; - -import "../../../../api_base/watch_query_adapter.dart"; -import "../../../../config/ttl_config.dart"; -import "getNews.graphql.dart"; - -part "news_repository.g.dart"; - -typedef NewsPost = Query$GetNews$Posts; - -@riverpod -Stream?> newsRepository(NewsRepositoryRef ref) async* { - final stream = ref.watchQueryWithCache( - WatchOptions$Query$GetNews(eagerlyFetchResults: true), - TtlKey.newsRepository, - ); - yield* stream.map((event) => event?.Posts); -} diff --git a/lib/features/offline_messages/messages_config.dart b/lib/features/offline_messages/messages_config.dart index 2e038201..d1f745eb 100644 --- a/lib/features/offline_messages/messages_config.dart +++ b/lib/features/offline_messages/messages_config.dart @@ -6,7 +6,6 @@ import "../../utils/context_extensions.dart"; extension GqlOfflineMessageX on BuildContext { UnmodifiableTtlKeyMap _offlineMessagesLocalized() => UnmodifiableTtlKeyMap( - newsRepository: localize.offline_news, academicCalendarRepository: localize.offline_academic_calendar, scienceClubDetailsRepository: localize.offline_sci_clubs, scienceClubsRepository: localize.offline_sci_clubs, @@ -16,6 +15,7 @@ extension GqlOfflineMessageX on BuildContext { aboutUsRepository: localize.offline_about_us, departmentDetailsRepository: localize.offline_department_details, guideDetailsRepository: localize.offline_guide_details, + guideViewRepository: localize.offline_guide_posts, ); String gqlOfflineMessageLocalized(TtlKey key) { diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index 734dda5b..2fbf2364 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -69,6 +69,7 @@ "offline_about_us":"o nas", "offline_department_details":"wydziału", "offline_guide_details":"wpisu z przewodnika", + "offline_guide_posts":"wpisów z przewodnika", "guide": "Przewodnik", "deans_office" : "Dziekanat", "fields_of_study" : "Kierunki"