mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
fix(mobile): Widget overflow due to exception on logout (#3869)
This commit is contained in:
parent
6fe214a784
commit
1b0484fc46
@ -30,9 +30,9 @@ class HomePageAppBar extends ConsumerWidget implements PreferredSizeWidget {
|
|||||||
backupState.backgroundBackup || backupState.autoBackup;
|
backupState.backgroundBackup || backupState.autoBackup;
|
||||||
final ServerInfoState serverInfoState = ref.watch(serverInfoProvider);
|
final ServerInfoState serverInfoState = ref.watch(serverInfoProvider);
|
||||||
AuthenticationState authState = ref.watch(authenticationProvider);
|
AuthenticationState authState = ref.watch(authenticationProvider);
|
||||||
final user = Store.get(StoreKey.currentUser);
|
final user = Store.tryGet(StoreKey.currentUser);
|
||||||
buildProfilePhoto() {
|
buildProfilePhoto() {
|
||||||
if (authState.profileImagePath.isEmpty) {
|
if (authState.profileImagePath.isEmpty || user == null) {
|
||||||
return IconButton(
|
return IconButton(
|
||||||
splashRadius: 25,
|
splashRadius: 25,
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
|
@ -20,16 +20,10 @@ class ProfileDrawerHeader extends HookConsumerWidget {
|
|||||||
final uploadProfileImageStatus =
|
final uploadProfileImageStatus =
|
||||||
ref.watch(uploadProfileImageProvider).status;
|
ref.watch(uploadProfileImageProvider).status;
|
||||||
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||||
final user = Store.get(StoreKey.currentUser);
|
final user = Store.tryGet(StoreKey.currentUser);
|
||||||
|
|
||||||
buildUserProfileImage() {
|
buildUserProfileImage() {
|
||||||
var userImage = UserCircleAvatar(
|
if (authState.profileImagePath.isEmpty || user == null) {
|
||||||
radius: 35,
|
|
||||||
size: 66,
|
|
||||||
user: user,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (authState.profileImagePath.isEmpty) {
|
|
||||||
return const CircleAvatar(
|
return const CircleAvatar(
|
||||||
radius: 35,
|
radius: 35,
|
||||||
backgroundImage: AssetImage('assets/immich-logo-no-outline.png'),
|
backgroundImage: AssetImage('assets/immich-logo-no-outline.png'),
|
||||||
@ -37,6 +31,12 @@ class ProfileDrawerHeader extends HookConsumerWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var userImage = UserCircleAvatar(
|
||||||
|
radius: 35,
|
||||||
|
size: 66,
|
||||||
|
user: user,
|
||||||
|
);
|
||||||
|
|
||||||
if (uploadProfileImageStatus == UploadProfileStatus.idle) {
|
if (uploadProfileImageStatus == UploadProfileStatus.idle) {
|
||||||
if (authState.profileImagePath.isNotEmpty) {
|
if (authState.profileImagePath.isNotEmpty) {
|
||||||
return userImage;
|
return userImage;
|
||||||
|
Loading…
Reference in New Issue
Block a user