refactor(mobile): immich loading overlay (#5320)

* refactor: dcm fixes

* refactor: ImmichLoadingOverlay to custom hook

* chore: dart fixes

* pr changes

* fix: process overlay add / remove in postframecallback

---------

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
shenlong
2023-11-29 04:20:00 +00:00
committed by GitHub
parent 513f252a0c
commit 527d602a9f
12 changed files with 146 additions and 128 deletions

View File

@@ -24,6 +24,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
final owner = album.owner.value;
final userId = ref.watch(authenticationProvider).userId;
final activityEnabled = useState(album.activityEnabled);
final isProcessing = useProcessingOverlay();
final isOwner = owner?.id == userId;
void showErrorMessage() {
@@ -37,7 +38,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
}
void leaveAlbum() async {
ImmichLoadingOverlayController.appLoader.show();
isProcessing.value = true;
try {
final isSuccess =
@@ -54,11 +55,11 @@ class AlbumOptionsPage extends HookConsumerWidget {
showErrorMessage();
}
ImmichLoadingOverlayController.appLoader.hide();
isProcessing.value = false;
}
void removeUserFromAlbum(User user) async {
ImmichLoadingOverlayController.appLoader.show();
isProcessing.value = true;
try {
await ref
@@ -71,7 +72,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
}
context.pop();
ImmichLoadingOverlayController.appLoader.hide();
isProcessing.value = false;
}
void handleUserClick(User user) {