mirror of
https://github.com/immich-app/immich.git
synced 2025-08-11 09:16:31 -04:00
fix: don't show remove from album action from the main timeline (#20757)
* fix: don't show remove from album action from the main timeline * pr feedback
This commit is contained in:
parent
a896c5a4dd
commit
7b83b7b2d5
@ -10,6 +10,7 @@ import 'package:immich_mobile/presentation/widgets/bottom_sheet/remote_album_bot
|
|||||||
import 'package:immich_mobile/presentation/widgets/remote_album/drift_album_option.widget.dart';
|
import 'package:immich_mobile/presentation/widgets/remote_album/drift_album_option.widget.dart';
|
||||||
import 'package:immich_mobile/presentation/widgets/timeline/timeline.widget.dart';
|
import 'package:immich_mobile/presentation/widgets/timeline/timeline.widget.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
|
||||||
|
import 'package:immich_mobile/providers/infrastructure/current_album.provider.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/remote_album.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/remote_album.provider.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
|
||||||
import 'package:immich_mobile/providers/user.provider.dart';
|
import 'package:immich_mobile/providers/user.provider.dart';
|
||||||
@ -215,7 +216,18 @@ class _RemoteAlbumPageState extends ConsumerState<RemoteAlbumPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ProviderScope(
|
return PopScope(
|
||||||
|
onPopInvokedWithResult: (didPop, _) {
|
||||||
|
if (didPop) {
|
||||||
|
Future.microtask(() {
|
||||||
|
if (mounted) {
|
||||||
|
ref.read(currentRemoteAlbumProvider.notifier).dispose();
|
||||||
|
ref.read(remoteAlbumProvider.notifier).refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: ProviderScope(
|
||||||
overrides: [
|
overrides: [
|
||||||
timelineServiceProvider.overrideWith((ref) {
|
timelineServiceProvider.overrideWith((ref) {
|
||||||
final timelineService = ref.watch(timelineFactoryProvider).remoteAlbum(albumId: _album.id);
|
final timelineService = ref.watch(timelineFactoryProvider).remoteAlbum(albumId: _album.id);
|
||||||
@ -232,6 +244,7 @@ class _RemoteAlbumPageState extends ConsumerState<RemoteAlbumPage> {
|
|||||||
),
|
),
|
||||||
bottomSheet: RemoteAlbumBottomSheet(album: _album),
|
bottomSheet: RemoteAlbumBottomSheet(album: _album),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,5 +31,6 @@ class CurrentAlbumNotifier extends AutoDisposeNotifier<RemoteAlbum?> {
|
|||||||
void dispose() {
|
void dispose() {
|
||||||
_keepAliveLink?.close();
|
_keepAliveLink?.close();
|
||||||
_assetSubscription?.cancel();
|
_assetSubscription?.cancel();
|
||||||
|
state = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
|||||||
import 'package:immich_mobile/extensions/datetime_extensions.dart';
|
import 'package:immich_mobile/extensions/datetime_extensions.dart';
|
||||||
import 'package:immich_mobile/extensions/translate_extensions.dart';
|
import 'package:immich_mobile/extensions/translate_extensions.dart';
|
||||||
import 'package:immich_mobile/presentation/widgets/images/image_provider.dart';
|
import 'package:immich_mobile/presentation/widgets/images/image_provider.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/album.provider.dart';
|
|
||||||
import 'package:immich_mobile/providers/infrastructure/current_album.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/current_album.provider.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/remote_album.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/remote_album.provider.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/timeline.provider.dart';
|
||||||
@ -74,14 +73,15 @@ class _MesmerizingSliverAppBarState extends ConsumerState<RemoteAlbumSliverAppBa
|
|||||||
const Shadow(offset: Offset(0, 2), blurRadius: 0, color: Colors.transparent),
|
const Shadow(offset: Offset(0, 2), blurRadius: 0, color: Colors.transparent),
|
||||||
];
|
];
|
||||||
|
|
||||||
return isMultiSelectEnabled
|
if (isMultiSelectEnabled) {
|
||||||
? SliverToBoxAdapter(
|
return SliverToBoxAdapter(
|
||||||
child: switch (_scrollProgress) {
|
child: switch (_scrollProgress) {
|
||||||
< 0.8 => const SizedBox(height: 120),
|
< 0.8 => const SizedBox(height: 120),
|
||||||
_ => const SizedBox(height: 452),
|
_ => const SizedBox(height: 452),
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
: SliverAppBar(
|
} else {
|
||||||
|
return SliverAppBar(
|
||||||
expandedHeight: 400.0,
|
expandedHeight: 400.0,
|
||||||
floating: false,
|
floating: false,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
@ -93,10 +93,7 @@ class _MesmerizingSliverAppBarState extends ConsumerState<RemoteAlbumSliverAppBa
|
|||||||
color: actionIconColor,
|
color: actionIconColor,
|
||||||
shadows: actionIconShadows,
|
shadows: actionIconShadows,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () => context.navigateTo(const TabShellRoute(children: [DriftAlbumsRoute()])),
|
||||||
ref.read(remoteAlbumProvider.notifier).refresh();
|
|
||||||
context.navigateTo(const TabShellRoute(children: [DriftAlbumsRoute()]));
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
if (widget.onToggleAlbumOrder != null)
|
if (widget.onToggleAlbumOrder != null)
|
||||||
@ -145,6 +142,7 @@ class _MesmerizingSliverAppBarState extends ConsumerState<RemoteAlbumSliverAppBa
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ExpandedBackground extends ConsumerStatefulWidget {
|
class _ExpandedBackground extends ConsumerStatefulWidget {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user