Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ There are multiple ways of getting support:

- create a [new issue](https://github.com/dedicatedcode/reitti/issues/new/choose)
- tag me on [Lemmy](https://discuss.tchncs.de/u/danielgraf)
- or join **#reitti** on [irc.dedicatedcode.com](https://irc.dedicatedcode.com)
- or join **#reitti** on [libera.chat](https://libera.chat)

## Translations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public UserSettingsDTO getCurrentUserSettings() {
// Return default settings for anonymous users
return new UserSettingsDTO(false,
Language.EN,
Locale.ENGLISH,
Locale.ENGLISH.toLanguageTag(),
Instant.now(),
UnitSystem.METRIC,
DEFAULT_HOME_LATITUDE,
Expand All @@ -77,7 +77,7 @@ public UserSettingsDTO getCurrentUserSettings() {
Language selectedLanguage = dbSettings.getSelectedLanguage();
return new UserSettingsDTO(dbSettings.isPreferColoredMap(),
selectedLanguage,
selectedLanguage.getLocale(),
selectedLanguage.getLocale().toLanguageTag(),
latestData,
dbSettings.getUnitSystem(),
dbSettings.getHomeLatitude(),
Expand All @@ -92,7 +92,7 @@ public UserSettingsDTO getCurrentUserSettings() {
// Fallback for authenticated users not found in database
return new UserSettingsDTO(false,
Language.EN,
Locale.ENGLISH,
Locale.ENGLISH.toLanguageTag(),
Instant.now(),
UnitSystem.METRIC,
DEFAULT_HOME_LATITUDE,
Expand All @@ -119,6 +119,7 @@ private UserSettingsDTO.UIMode mapUserToUiMode(Authentication authentication) {
throw new IllegalStateException("Invalid user authentication mode detected [" + grantedRoles + "]");
}
}

private UserSettingsDTO.PhotoMode mapUserToPhotoMode(Authentication authentication) {
List<String> grantedRoles = authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority).toList();
if (grantedRoles.contains("ROLE_ADMIN") ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public record UserSettingsDTO(
boolean preferColoredMap,
Language selectedLanguage,
Locale selectedLocale,
String selectedLocale,
Instant newestData,
UnitSystem unitSystem,
Double homeLatitude,
Expand Down
Loading