Hide processing notification when removing from viewer

This commit is contained in:
Ming Ming 2022-10-17 00:14:34 +08:00
parent c398dabc03
commit f004fc6801
2 changed files with 11 additions and 7 deletions

View file

@ -27,6 +27,7 @@ class RemoveSelectionHandler {
bool shouldCleanupAlbum = true,
bool isRemoveOpened = false,
bool isMoveToTrash = false,
bool shouldShowProcessingText = true,
}) async {
final selectedFiles = await InflateFileDescriptor(_c)(account, selection);
final String processingText, successText;
@ -42,13 +43,15 @@ class RemoveSelectionHandler {
failureText =
(count) => L10n.global().deleteSelectedFailureNotification(count);
}
SnackBarManager().showSnackBar(
SnackBar(
content: Text(processingText),
duration: k.snackBarDurationShort,
),
canBeReplaced: true,
);
if (shouldShowProcessingText) {
SnackBarManager().showSnackBar(
SnackBar(
content: Text(processingText),
duration: k.snackBarDurationShort,
),
canBeReplaced: true,
);
}
var failureCount = 0;
await Remove(KiwiContainer().resolve<DiContainer>())(

View file

@ -653,6 +653,7 @@ class _ViewerState extends State<Viewer>
selection: [file],
isRemoveOpened: true,
isMoveToTrash: true,
shouldShowProcessingText: false,
));
_removeCurrentItemFromStream(context, index);
}