mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(mobile): use user service methods (#16783)
* refactor: user entity * chore: rebase fixes * refactor(mobile): refactor to use user service methods * fix: late init error * fix: lint --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
6c2985df26
commit
dd263b010c
17 changed files with 137 additions and 143 deletions
|
|
@ -1,8 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||
import 'package:immich_mobile/entities/store.entity.dart';
|
||||
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
||||
import 'package:immich_mobile/extensions/theme_extensions.dart';
|
||||
import 'package:immich_mobile/providers/auth.provider.dart';
|
||||
|
|
@ -21,7 +19,7 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
|||
final authState = ref.watch(authProvider);
|
||||
final uploadProfileImageStatus =
|
||||
ref.watch(uploadProfileImageProvider).status;
|
||||
final user = Store.tryGet(StoreKey.currentUser);
|
||||
final user = ref.watch(currentUserProvider);
|
||||
|
||||
buildUserProfileImage() {
|
||||
if (user == null) {
|
||||
|
|
@ -67,9 +65,6 @@ class AppBarProfileInfoBox extends HookConsumerWidget {
|
|||
profileImagePath,
|
||||
);
|
||||
if (user != null) {
|
||||
final updatedUser =
|
||||
user.copyWith(profileImagePath: profileImagePath);
|
||||
await Store.put(StoreKey.currentUser, updatedUser);
|
||||
ref.read(currentUserProvider.notifier).refresh();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue