Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Update ordering of actions

Vishnu Mohandasde15d16bc00f
diff --git a/lib/ui/viewer/actions/file_selection_actions_widget.dart b/lib/ui/viewer/actions/file_selection_actions_widget.dart
index dbbf5c4df7..74d93e4b70 100644
--- a/lib/ui/viewer/actions/file_selection_actions_widget.dart
+++ b/lib/ui/viewer/actions/file_selection_actions_widget.dart
@@ -1,3 +1,5 @@
+import "dart:async";
+
import 'package:fast_base58/fast_base58.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -219,17 +221,6 @@ class _FileSelectionActionsWidgetState
);
}
- if (widget.type.showDeleteOption()) {
- items.add(
- SelectionActionButton(
- icon: Icons.delete_outline,
- labelText: S.of(context).delete,
- onTap: anyOwnedFiles ? _onDeleteClick : null,
- shouldShow: ownedAndPendingUploadFilesCount > 0,
- ),
- );
- }
-
if (widget.type.showFavoriteOption()) {
items.add(
SelectionActionButton(
@@ -250,6 +241,26 @@ class _FileSelectionActionsWidgetState
);
}
+ items.add(
+ SelectionActionButton(
+ icon: Icons.grid_view_outlined,
+ labelText: S.of(context).createCollage,
+ onTap: _onCreateCollageClicked,
+ shouldShow: showCollageOption,
+ ),
+ );
+
+ if (widget.type.showDeleteOption()) {
+ items.add(
+ SelectionActionButton(
+ icon: Icons.delete_outline,
+ labelText: S.of(context).delete,
+ onTap: anyOwnedFiles ? _onDeleteClick : null,
+ shouldShow: ownedAndPendingUploadFilesCount > 0,
+ ),
+ );
+ }
+
if (widget.type.showHideOption()) {
items.add(
SelectionActionButton(
@@ -309,15 +320,6 @@ class _FileSelectionActionsWidgetState
);
}
- items.add(
- SelectionActionButton(
- icon: Icons.grid_view_outlined,
- labelText: S.of(context).createCollage,
- onTap: _onCreateCollageClicked,
- shouldShow: showCollageOption,
- ),
- );
-
if (items.isNotEmpty) {
final scrollController = ScrollController();
// h4ck: https://github.com/flutter/flutter/issues/57920#issuecomment-893970066
@@ -500,9 +502,11 @@ class _FileSelectionActionsWidgetState
Future<void> _onCreatedSharedLinkClicked() async {
if (split.ownedByCurrentUser.isEmpty) {
- showShortToast(
- context,
- S.of(context).canOnlyCreateLinkForFilesOwnedByYou,
+ unawaited(
+ showShortToast(
+ context,
+ S.of(context).canOnlyCreateLinkForFilesOwnedByYou,
+ ),
);
return;
}
@@ -545,7 +549,7 @@ class _FileSelectionActionsWidgetState
await _copyLink();
}
if (actionResult.action == ButtonAction.second) {
- routeToPage(
+ await routeToPage(
context,
ManageSharedLinkWidget(collection: _cachedCollectionForSharedLink),
);
@@ -566,7 +570,7 @@ class _FileSelectionActionsWidgetState
final String url =
"${_cachedCollectionForSharedLink!.publicURLs?.first?.url}#$collectionKey";
await Clipboard.setData(ClipboardData(text: url));
- showShortToast(context, S.of(context).linkCopiedToClipboard);
+ unawaited(showShortToast(context, S.of(context).linkCopiedToClipboard));
}
}