string replace end of choreo url (#1158)

This commit is contained in:
ggurdin 2024-12-05 15:09:40 -05:00 committed by GitHub
parent 3d292b2255
commit d58705dae7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 6 deletions

View file

@ -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";
}
@ -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 {

View file

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