mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
feat(mobile): shared album activity disable handling (#4890)
* feat(mobile): shared album activity disable handling * not show comment/like option on non-shared album, alternative text when activity is disabled --------- 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:
@@ -23,6 +23,7 @@ class AlbumOptionsPage extends HookConsumerWidget {
|
||||
final sharedUsers = useState(album.sharedUsers.toList());
|
||||
final owner = album.owner.value;
|
||||
final userId = ref.watch(authenticationProvider).userId;
|
||||
final activityEnabled = useState(album.activityEnabled);
|
||||
final isOwner = owner?.id == userId;
|
||||
|
||||
void showErrorMessage() {
|
||||
@@ -195,6 +196,31 @@ class AlbumOptionsPage extends HookConsumerWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (isOwner && album.shared)
|
||||
SwitchListTile.adaptive(
|
||||
value: activityEnabled.value,
|
||||
onChanged: (bool value) async {
|
||||
activityEnabled.value = value;
|
||||
if (await ref
|
||||
.read(sharedAlbumProvider.notifier)
|
||||
.setActivityEnabled(album, value)) {
|
||||
album.activityEnabled = value;
|
||||
}
|
||||
},
|
||||
activeColor: activityEnabled.value
|
||||
? Theme.of(context).primaryColor
|
||||
: Theme.of(context).disabledColor,
|
||||
dense: true,
|
||||
title: Text(
|
||||
"shared_album_activity_setting_title",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.labelLarge
|
||||
?.copyWith(fontWeight: FontWeight.bold),
|
||||
).tr(),
|
||||
subtitle:
|
||||
const Text("shared_album_activity_setting_subtitle").tr(),
|
||||
),
|
||||
buildSectionTitle("PEOPLE"),
|
||||
buildOwnerInfo(),
|
||||
buildSharedUsersList(),
|
||||
|
||||
@@ -239,6 +239,7 @@ class AlbumViewerPage extends HookConsumerWidget {
|
||||
albumId: album.remoteId!,
|
||||
appBarTitle: album.name,
|
||||
isOwner: userId == album.ownerId,
|
||||
isReadOnly: !album.activityEnabled,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -279,7 +280,8 @@ class AlbumViewerPage extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
isOwner: userId == data.ownerId,
|
||||
sharedAlbumId: data.remoteId,
|
||||
sharedAlbumId:
|
||||
data.shared && data.activityEnabled ? data.remoteId : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user