Skip to content

Commit

Permalink
fix: dismiss drive file move on pop
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Nov 9, 2024
1 parent ceff6f7 commit 644a50b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/view/page/drive_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class DrivePage extends HookConsumerWidget {
final stats = !selectFiles && !selectFolder
? ref.watch(driveStatsProvider(account)).valueOrNull
: null;
final isSelecting = selectFiles || selectedFiles.isNotEmpty;
final isSelecting =
selectFiles || (!selectFolder && selectedFiles.isNotEmpty);
final controller = useScrollController();
final isAtBottom = useState(false);
useEffect(
Expand Down Expand Up @@ -93,9 +94,9 @@ class DrivePage extends HookConsumerWidget {
ref.watch(misskeyColorsProvider(Theme.of(context).brightness));

return PopScope(
canPop: currentFolder == null && selectedFiles.isEmpty,
canPop: currentFolder == null && (selectFolder || selectedFiles.isEmpty),
onPopInvokedWithResult: (_, __) {
if (selectedFiles.isNotEmpty) {
if (!selectFolder && selectedFiles.isNotEmpty) {
ref.read(selectedDriveFilesNotifierProvider.notifier).removeAll();
} else if (currentFolder != null) {
hierarchyFolders.value = hierarchyFolders.value
Expand All @@ -106,7 +107,7 @@ class DrivePage extends HookConsumerWidget {
appBar: AppBar(
leading:
selectedFiles.isEmpty ? const BackButton() : const CloseButton(),
title: selectFiles || selectedFiles.isNotEmpty
title: selectFiles || (!selectFolder && selectedFiles.isNotEmpty)
? Text.rich(
TextSpan(
text: t.misskey.selectFiles,
Expand Down

0 comments on commit 644a50b

Please sign in to comment.