Skip to content

High performance self-hosted photo and video management solution.

fix(mobile): prevent upload intent replacement in splash screen and reset upload button when minimize app (#18914)

JobiJoba1fb8861e3559
diff --git a/mobile/lib/pages/common/splash_screen.page.dart b/mobile/lib/pages/common/splash_screen.page.dart
index 5ea9351c0e..b640aaa3ed 100644
--- a/mobile/lib/pages/common/splash_screen.page.dart
+++ b/mobile/lib/pages/common/splash_screen.page.dart
@@ -72,7 +72,9 @@ class SplashScreenPageState extends ConsumerState<SplashScreenPage> {
return;
}
- context.replaceRoute(const TabControllerRoute());
+ if (context.router.current.name != ShareIntentRoute.name) {
+ context.replaceRoute(const TabControllerRoute());
+ }
final hasPermission =
await ref.read(galleryPermissionNotifier.notifier).hasPermission;
diff --git a/mobile/lib/pages/share_intent/share_intent.page.dart b/mobile/lib/pages/share_intent/share_intent.page.dart
index ff137ce0aa..3ff1b0c8ce 100644
--- a/mobile/lib/pages/share_intent/share_intent.page.dart
+++ b/mobile/lib/pages/share_intent/share_intent.page.dart
@@ -7,6 +7,7 @@ import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/models/upload/share_intent_attachment.model.dart';
import 'package:immich_mobile/pages/common/large_leading_tile.dart';
import 'package:immich_mobile/providers/asset_viewer/share_intent_upload.provider.dart';
+import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/utils/url_helper.dart';
@RoutePage()
@@ -20,6 +21,11 @@ class ShareIntentPage extends HookConsumerWidget {
final currentEndpoint = getServerUrl() ?? '--';
final candidates = ref.watch(shareIntentUploadProvider);
final isUploaded = useState(false);
+ useOnAppLifecycleStateChange((previous, current) {
+ if (current == AppLifecycleState.resumed) {
+ isUploaded.value = false;
+ }
+ });
void removeAttachment(ShareIntentAttachment attachment) {
ref.read(shareIntentUploadProvider.notifier).removeAttachment(attachment);
@@ -66,6 +72,14 @@ class ShareIntentPage extends HookConsumerWidget {
),
],
),
+ leading: IconButton(
+ onPressed: () {
+ context.navigateTo(
+ const TabControllerRoute(),
+ );
+ },
+ icon: const Icon(Icons.arrow_back),
+ ),
),
body: ListView.builder(
itemCount: attachments.length,