mirror of
https://github.com/immich-app/immich.git
synced 2026-03-09 19:57:41 +03:00
chore: bump line length to 120 (#20191)
This commit is contained in:
@@ -12,8 +12,7 @@ import 'package:immich_mobile/providers/album/current_album.provider.dart';
|
||||
import 'package:immich_mobile/routing/router.dart';
|
||||
import 'package:immich_mobile/widgets/common/immich_toast.dart';
|
||||
|
||||
class AlbumViewerAppbar extends HookConsumerWidget
|
||||
implements PreferredSizeWidget {
|
||||
class AlbumViewerAppbar extends HookConsumerWidget implements PreferredSizeWidget {
|
||||
const AlbumViewerAppbar({
|
||||
super.key,
|
||||
required this.userId,
|
||||
@@ -53,13 +52,10 @@ class AlbumViewerAppbar extends HookConsumerWidget
|
||||
final newAlbumDescription = albumViewer.editDescriptionText;
|
||||
final isEditAlbum = albumViewer.isEditAlbum;
|
||||
|
||||
final comments = album.shared
|
||||
? ref.watch(activityStatisticsProvider(album.remoteId!))
|
||||
: 0;
|
||||
final comments = album.shared ? ref.watch(activityStatisticsProvider(album.remoteId!)) : 0;
|
||||
|
||||
deleteAlbum() async {
|
||||
final bool success =
|
||||
await ref.watch(albumProvider.notifier).deleteAlbum(album);
|
||||
final bool success = await ref.watch(albumProvider.notifier).deleteAlbum(album);
|
||||
|
||||
context.navigateTo(const TabControllerRoute(children: [AlbumsRoute()]));
|
||||
|
||||
@@ -112,8 +108,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
|
||||
}
|
||||
|
||||
void onLeaveAlbumPressed() async {
|
||||
bool isSuccess =
|
||||
await ref.watch(albumProvider.notifier).leaveAlbum(album);
|
||||
bool isSuccess = await ref.watch(albumProvider.notifier).leaveAlbum(album);
|
||||
|
||||
if (isSuccess) {
|
||||
context.navigateTo(const TabControllerRoute(children: [AlbumsRoute()]));
|
||||
@@ -152,8 +147,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
|
||||
}
|
||||
|
||||
void onSortOrderToggled() async {
|
||||
final updatedAlbum =
|
||||
await ref.read(albumProvider.notifier).toggleSortOrder(album);
|
||||
final updatedAlbum = await ref.read(albumProvider.notifier).toggleSortOrder(album);
|
||||
|
||||
if (updatedAlbum == null) {
|
||||
ImmichToast.show(
|
||||
@@ -241,8 +235,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
|
||||
children: [
|
||||
...buildBottomSheetActions(),
|
||||
if (onAddPhotos != null) ...commonActions,
|
||||
if (onAddPhotos != null && userId == album.ownerId)
|
||||
...ownerActions,
|
||||
if (onAddPhotos != null && userId == album.ownerId) ...ownerActions,
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -281,9 +274,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
if (newAlbumTitle.isNotEmpty) {
|
||||
bool isSuccess = await ref
|
||||
.watch(albumViewerProvider.notifier)
|
||||
.changeAlbumTitle(album, newAlbumTitle);
|
||||
bool isSuccess = await ref.watch(albumViewerProvider.notifier).changeAlbumTitle(album, newAlbumTitle);
|
||||
if (!isSuccess) {
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
@@ -294,9 +285,8 @@ class AlbumViewerAppbar extends HookConsumerWidget
|
||||
}
|
||||
titleFocusNode.unfocus();
|
||||
} else if (newAlbumDescription.isNotEmpty) {
|
||||
bool isSuccessDescription = await ref
|
||||
.watch(albumViewerProvider.notifier)
|
||||
.changeAlbumDescription(album, newAlbumDescription);
|
||||
bool isSuccessDescription =
|
||||
await ref.watch(albumViewerProvider.notifier).changeAlbumDescription(album, newAlbumDescription);
|
||||
if (!isSuccessDescription) {
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
@@ -330,8 +320,7 @@ class AlbumViewerAppbar extends HookConsumerWidget
|
||||
leading: buildLeadingButton(),
|
||||
centerTitle: false,
|
||||
actions: [
|
||||
if (album.shared && (album.activityEnabled || comments != 0))
|
||||
buildActivitiesButton(),
|
||||
if (album.shared && (album.activityEnabled || comments != 0)) buildActivitiesButton(),
|
||||
if (album.isRemote) ...[
|
||||
IconButton(
|
||||
splashRadius: 25,
|
||||
|
||||
Reference in New Issue
Block a user