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
1 changed files with 12 additions and 2 deletions
|
@ -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 a new issue