From 4e4755d0a55759603bef0c77f9c8e30c57569f97 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 16 Jan 2024 11:03:28 -0500 Subject: [PATCH] fix for fetching language list --- lib/pangea/config/environment.dart | 1 - lib/pangea/controllers/language_list_controller.dart | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pangea/config/environment.dart b/lib/pangea/config/environment.dart index b33854fd7..c4a6a028d 100644 --- a/lib/pangea/config/environment.dart +++ b/lib/pangea/config/environment.dart @@ -27,7 +27,6 @@ class Environment { } static String get choreoApi { - return "http://localhost:8000/choreo"; return dotenv.env['CHOREO_API'] ?? 'Not found'; } diff --git a/lib/pangea/controllers/language_list_controller.dart b/lib/pangea/controllers/language_list_controller.dart index 087c1804f..345d5b5e7 100644 --- a/lib/pangea/controllers/language_list_controller.dart +++ b/lib/pangea/controllers/language_list_controller.dart @@ -58,6 +58,12 @@ class PangeaLanguage { return true; } // return true; + final DateTime lastFetchedDate = DateTime.parse(dateString); + final DateTime targetDate = DateTime(2024, 1, 15); + if (lastFetchedDate.isBefore(targetDate)) { + return true; + } + final int lastFetched = DateTime.parse(dateString).millisecondsSinceEpoch; final int now = DateTime.now().millisecondsSinceEpoch; const int fetchIntervalInMilliseconds = 86534601;