mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 15:11:58 +00:00
fix(mobile): allow create empty non-shared albums, add proper button colors (#12103)
* Add proper colors to create album button Allow creation of empty albums with names, or non-empty albums without names * Add proper colors to create album button Allow creation of empty albums with names, or non-empty albums without names * Small changes * Revert change * Simplify logic * lint --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
c008feca63
commit
682adaa334
1 changed files with 6 additions and 3 deletions
|
@ -52,6 +52,7 @@ class CreateAlbumPage extends HookConsumerWidget {
|
||||||
|
|
||||||
if (albumTitleController.text.isEmpty) {
|
if (albumTitleController.text.isEmpty) {
|
||||||
albumTitleController.text = 'create_album_page_untitled'.tr();
|
albumTitleController.text = 'create_album_page_untitled'.tr();
|
||||||
|
isAlbumTitleEmpty.value = false;
|
||||||
ref
|
ref
|
||||||
.watch(albumTitleProvider.notifier)
|
.watch(albumTitleProvider.notifier)
|
||||||
.setAlbumTitle('create_album_page_untitled'.tr());
|
.setAlbumTitle('create_album_page_untitled'.tr());
|
||||||
|
@ -191,6 +192,7 @@ class CreateAlbumPage extends HookConsumerWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
createNonSharedAlbum() async {
|
createNonSharedAlbum() async {
|
||||||
|
onBackgroundTapped();
|
||||||
var newAlbum = await ref.watch(albumProvider.notifier).createAlbum(
|
var newAlbum = await ref.watch(albumProvider.notifier).createAlbum(
|
||||||
ref.watch(albumTitleProvider),
|
ref.watch(albumTitleProvider),
|
||||||
selectedAssets.value,
|
selectedAssets.value,
|
||||||
|
@ -238,15 +240,16 @@ class CreateAlbumPage extends HookConsumerWidget {
|
||||||
),
|
),
|
||||||
if (!isSharedAlbum)
|
if (!isSharedAlbum)
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: albumTitleController.text.isNotEmpty &&
|
onPressed: albumTitleController.text.isNotEmpty
|
||||||
selectedAssets.value.isNotEmpty
|
|
||||||
? createNonSharedAlbum
|
? createNonSharedAlbum
|
||||||
: null,
|
: null,
|
||||||
child: Text(
|
child: Text(
|
||||||
'create_shared_album_page_create'.tr(),
|
'create_shared_album_page_create'.tr(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: context.primaryColor,
|
color: albumTitleController.text.isNotEmpty
|
||||||
|
? context.primaryColor
|
||||||
|
: context.themeData.disabledColor,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue