Skip to content

Commit

Permalink
string replace end of choreo url (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggurdin authored Dec 5, 2024
1 parent 3d292b2 commit d58705d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions lib/pangea/config/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class Environment {

static bool get isStaging => synapsURL.contains("staging");

static String get baseAPI {
return dotenv.env["BASE_API"] ?? 'BASE API not found';
}

static String get frontendURL {
return dotenv.env["FRONTEND_URL"] ?? "Frontend URL NOT FOUND";
}
Expand All @@ -27,7 +23,17 @@ class Environment {
}

static String get choreoApi {
return dotenv.env['CHOREO_API'] ?? 'Not found';
final envEntry = dotenv.env['CHOREO_API'];
if (envEntry == null) {
return "Not found";
}
if (envEntry.endsWith("/choreo")) {
return envEntry.replaceAll("/choreo", "");
}
if (envEntry.endsWith("/choreo/")) {
return envEntry.replaceAll("/choreo/", "");
}
return envEntry;
}

static String get choreoApiKey {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
# Pangea#
publish_to: none
# On version bump also increase the build number for F-Droid
version: 1.23.16+3575
version: 1.23.17+3576

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down

0 comments on commit d58705d

Please sign in to comment.