Skip to content

Commit

Permalink
Merge pull request #505 from helpwave/issue/504-use-lower-case-name
Browse files Browse the repository at this point in the history
Issue/504 use lower case name
  • Loading branch information
florian4f6c6 authored Feb 21, 2024
2 parents 259f17d + 24cc381 commit bde109b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions apps/tasks/lib/config/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ const minimumPasswordCharacters = 6;
/// Whether the development mode should be enabled
///
/// Shortens the login
const bool DEV_MODE = false;
const bool devMode = false;

/// The API for testing
const String STAGING_API_URL = "staging.api.helpwave.de";
const String stagingAPIURL = "staging.api.helpwave.de";

/// The API for production
const String PRODUCTION_API_URL = "api.helpwave.de";
const String productionAPIURL = "api.helpwave.de";

/// The API to be used
const String USED_API_URL = DEV_MODE ? STAGING_API_URL : PRODUCTION_API_URL;
const String usedAPIURL = devMode ? stagingAPIURL : productionAPIURL;
6 changes: 3 additions & 3 deletions apps/tasks/lib/services/current_ward_svc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class CurrentWardService extends Listenable {
final List<VoidCallback> _listeners = [];

CurrentWardService._initialize() {
if (!DEV_MODE) {
if (!devMode) {
load();
}
}
Expand All @@ -102,7 +102,7 @@ class CurrentWardService extends Listenable {
factory CurrentWardService() => _currentWardService;

set currentWard(CurrentWardInformation? currentWard) {
if (!DEV_MODE) {
if (!devMode) {
if (currentWard == null) {
_preferences.clear();
} else {
Expand All @@ -124,7 +124,7 @@ class CurrentWardService extends Listenable {
/// Load the preferences with the [_CurrentWardPreferences]
Future<void> load() async {
// everything is done in the setter
currentWard = DEV_MODE ? null : await _preferences.getInformation();
currentWard = devMode ? null : await _preferences.getInformation();
}

/// Fetch [Ward] and [Organization] from backend
Expand Down
4 changes: 2 additions & 2 deletions apps/tasks/lib/services/grpc_client_svc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import 'user_session_service.dart';
/// The Underlying GrpcService it provides other clients and the correct metadata for the requests
class GRPCClientService {
static final taskServiceChannel = ClientChannel(
USED_API_URL,
usedAPIURL,
);
static final userServiceChannel = ClientChannel(
USED_API_URL,
usedAPIURL,
);

final UserSessionService authService = UserSessionService();
Expand Down
6 changes: 3 additions & 3 deletions apps/tasks/lib/services/user_session_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UserSessionService {
///
/// Sets the [hasTriedTokens] to true
Future<void> tokenLogin() async {
if (!DEV_MODE) {
if (!devMode) {
_identity = await _authService.tokenLogin();
// new login required thus delete all saved information
if (_identity == null) {
Expand All @@ -43,14 +43,14 @@ class UserSessionService {

/// Logs a User in by a in app web view
Future<void> login() async {
if (!DEV_MODE) {
if (!devMode) {
_identity = await _authService.login();
}
}

/// Logs a User out and removes all stored information
logout() {
_identity = DEV_MODE ? Identity.defaultIdentity() : null;
_identity = devMode ? Identity.defaultIdentity() : null;
_hasTriedTokens = true;
_authService.revoke();
}
Expand Down

0 comments on commit bde109b

Please sign in to comment.