Skip to content

Commit

Permalink
Merge pull request #28 from pangeachat/lang-list-fix
Browse files Browse the repository at this point in the history
fix for fetching language list
  • Loading branch information
ggurdin authored Jan 16, 2024
2 parents 8620028 + 4e4755d commit eaf91a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/pangea/config/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Environment {
}

static String get choreoApi {
return "http://localhost:8000/choreo";
return dotenv.env['CHOREO_API'] ?? 'Not found';
}

Expand Down
6 changes: 6 additions & 0 deletions lib/pangea/controllers/language_list_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eaf91a5

Please sign in to comment.