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

View file

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