Skip to content

Commit d58705d

Browse files
authored
string replace end of choreo url (#1158)
1 parent 3d292b2 commit d58705d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lib/pangea/config/environment.dart

+11-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ class Environment {
1010

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

13-
static String get baseAPI {
14-
return dotenv.env["BASE_API"] ?? 'BASE API not found';
15-
}
16-
1713
static String get frontendURL {
1814
return dotenv.env["FRONTEND_URL"] ?? "Frontend URL NOT FOUND";
1915
}
@@ -27,7 +23,17 @@ class Environment {
2723
}
2824

2925
static String get choreoApi {
30-
return dotenv.env['CHOREO_API'] ?? 'Not found';
26+
final envEntry = dotenv.env['CHOREO_API'];
27+
if (envEntry == null) {
28+
return "Not found";
29+
}
30+
if (envEntry.endsWith("/choreo")) {
31+
return envEntry.replaceAll("/choreo", "");
32+
}
33+
if (envEntry.endsWith("/choreo/")) {
34+
return envEntry.replaceAll("/choreo/", "");
35+
}
36+
return envEntry;
3137
}
3238

3339
static String get choreoApiKey {

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
66
# Pangea#
77
publish_to: none
88
# On version bump also increase the build number for F-Droid
9-
version: 1.23.16+3575
9+
version: 1.23.17+3576
1010

1111
environment:
1212
sdk: ">=3.0.0 <4.0.0"

0 commit comments

Comments
 (0)