You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-09 23:17:29 +02:00
feat(server): user preferences (#9736)
* refactor(server): user endpoints * feat(server): user preferences * mobile: user preference * wording --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -177,8 +177,10 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
retResult = false;
|
||||
} else {
|
||||
UserAdminResponseDto? userResponseDto;
|
||||
UserPreferencesResponseDto? userPreferences;
|
||||
try {
|
||||
userResponseDto = await _apiService.userApi.getMyUser();
|
||||
userPreferences = await _apiService.userApi.getMyPreferences();
|
||||
} on ApiException catch (error, stackTrace) {
|
||||
_log.severe(
|
||||
"Error getting user information from the server [API EXCEPTION]",
|
||||
@@ -201,13 +203,13 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
Store.put(StoreKey.deviceIdHash, fastHash(deviceId));
|
||||
Store.put(
|
||||
StoreKey.currentUser,
|
||||
User.fromUserDto(userResponseDto),
|
||||
User.fromUserDto(userResponseDto, userPreferences),
|
||||
);
|
||||
Store.put(StoreKey.serverUrl, serverUrl);
|
||||
Store.put(StoreKey.accessToken, accessToken);
|
||||
|
||||
shouldChangePassword = userResponseDto.shouldChangePassword;
|
||||
user = User.fromUserDto(userResponseDto);
|
||||
user = User.fromUserDto(userResponseDto, userPreferences);
|
||||
|
||||
retResult = true;
|
||||
} else {
|
||||
|
@@ -21,10 +21,11 @@ class CurrentUserProvider extends StateNotifier<User?> {
|
||||
refresh() async {
|
||||
try {
|
||||
final user = await _apiService.userApi.getMyUser();
|
||||
final userPreferences = await _apiService.userApi.getMyPreferences();
|
||||
if (user != null) {
|
||||
Store.put(
|
||||
StoreKey.currentUser,
|
||||
User.fromUserDto(user),
|
||||
User.fromUserDto(user, userPreferences),
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
|
Reference in New Issue
Block a user