Merge pull request #28 from pangeachat/lang-list-fix

fix for fetching language list
This commit is contained in:
ggurdin 2024-01-16 11:04:12 -05:00 committed by GitHub
commit eaf91a5be9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -27,7 +27,6 @@ class Environment {
}
static String get choreoApi {
return "http://localhost:8000/choreo";
return dotenv.env['CHOREO_API'] ?? 'Not found';
}

View file

@ -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;