mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-02-10 18:29:22 +00:00
Implemented user profile upload and show on web/mobile (#191)
* Update mobile dependencies * Added image picker * Added mechanism to upload profile image * Added image type to send to web * Added styling for circle avatar * Fixxed issue with sharp cannot resize image properly * Finished displaying and uploading user profile * Added user profile to web
This commit is contained in:
@@ -17,9 +17,14 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
AuthenticationState(
|
||||
deviceId: "",
|
||||
deviceType: "",
|
||||
isAuthenticated: false,
|
||||
userId: "",
|
||||
userEmail: "",
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
profileImagePath: '',
|
||||
isAdmin: false,
|
||||
isFirstLogin: false,
|
||||
isAuthenticated: false,
|
||||
deviceInfo: DeviceInfoRemote(
|
||||
id: 0,
|
||||
userId: "",
|
||||
@@ -76,6 +81,11 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
isAuthenticated: true,
|
||||
userId: payload.userId,
|
||||
userEmail: payload.userEmail,
|
||||
firstName: payload.firstName,
|
||||
lastName: payload.lastName,
|
||||
profileImagePath: payload.profileImagePath,
|
||||
isAdmin: payload.isAdmin,
|
||||
isFirstLoggedIn: payload.isFirstLogin,
|
||||
);
|
||||
|
||||
if (isSavedLoginInfo) {
|
||||
@@ -114,9 +124,14 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
state = AuthenticationState(
|
||||
deviceId: "",
|
||||
deviceType: "",
|
||||
isAuthenticated: false,
|
||||
userId: "",
|
||||
userEmail: "",
|
||||
firstName: '',
|
||||
lastName: '',
|
||||
profileImagePath: '',
|
||||
isFirstLogin: false,
|
||||
isAuthenticated: false,
|
||||
isAdmin: false,
|
||||
deviceInfo: DeviceInfoRemote(
|
||||
id: 0,
|
||||
userId: "",
|
||||
@@ -139,6 +154,10 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
DeviceInfoRemote deviceInfoRemote = await _backupService.setAutoBackup(backupState, deviceId, deviceType);
|
||||
state = state.copyWith(deviceInfo: deviceInfoRemote);
|
||||
}
|
||||
|
||||
updateUserProfileImagePath(String path) {
|
||||
state = state.copyWith(profileImagePath: path);
|
||||
}
|
||||
}
|
||||
|
||||
final authenticationProvider = StateNotifierProvider<AuthenticationNotifier, AuthenticationState>((ref) {
|
||||
|
||||
Reference in New Issue
Block a user