mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
feat(mobile): Shows a toast after adding to favorites (#1714)
* shows toast on adding assets to favorites * add to favorites first * typo
This commit is contained in:
parent
b71a86142b
commit
e6f9d9a31a
@ -101,10 +101,20 @@ class HomePage extends HookConsumerWidget {
|
||||
}
|
||||
|
||||
void onFavoriteAssets() {
|
||||
final remoteAssests = remoteOnlySelection(
|
||||
final remoteAssets = remoteOnlySelection(
|
||||
localErrorMessage: 'Can not favorite local assets yet, skipping',
|
||||
);
|
||||
ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssests);
|
||||
if (remoteAssets.isNotEmpty) {
|
||||
ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssets);
|
||||
|
||||
final assetOrAssets = remoteAssets.length > 1 ? 'assets' : 'asset';
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
msg: 'Added ${remoteAssets.length} $assetOrAssets to favorites',
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
}
|
||||
|
||||
selectionEnabledHook.value = false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user