Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix naming

AmanRajSinghMourya6775faf0d041
diff --git a/mobile/apps/locker/lib/ui/pages/all_collections_page.dart b/mobile/apps/locker/lib/ui/pages/all_collections_page.dart
index a2bb0bb037..5219137a7d 100644
--- a/mobile/apps/locker/lib/ui/pages/all_collections_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/all_collections_page.dart
@@ -18,18 +18,18 @@ import 'package:locker/ui/pages/trash_page.dart';
import 'package:locker/utils/collection_sort_util.dart';
import 'package:logging/logging.dart';
-enum CollectionViewType {
- homeCollections,
- outgoingCollections,
+enum UISectionType {
incomingCollections,
+ outgoingCollections,
+ homeCollections,
}
class AllCollectionsPage extends StatefulWidget {
- final CollectionViewType viewType;
+ final UISectionType viewType;
const AllCollectionsPage({
super.key,
- this.viewType = CollectionViewType.homeCollections,
+ this.viewType = UISectionType.homeCollections,
});
@override
@@ -81,7 +81,7 @@ class _AllCollectionsPageState extends State<AllCollectionsPage>
Bus.instance.on<CollectionsUpdatedEvent>().listen((event) async {
await _loadCollections();
});
- if (widget.viewType == CollectionViewType.homeCollections) {
+ if (widget.viewType == UISectionType.homeCollections) {
showTrash = true;
showUncategorized = true;
}
@@ -96,14 +96,14 @@ class _AllCollectionsPageState extends State<AllCollectionsPage>
try {
List<Collection> collections = [];
- if (widget.viewType == CollectionViewType.homeCollections) {
+ if (widget.viewType == UISectionType.homeCollections) {
collections = await CollectionService.instance.getCollections();
} else {
final sharedCollections =
await CollectionService.instance.getSharedCollections();
- if (widget.viewType == CollectionViewType.outgoingCollections) {
+ if (widget.viewType == UISectionType.outgoingCollections) {
collections = sharedCollections.outgoing;
- } else if (widget.viewType == CollectionViewType.incomingCollections) {
+ } else if (widget.viewType == UISectionType.incomingCollections) {
collections = sharedCollections.incoming;
}
}
@@ -124,11 +124,11 @@ class _AllCollectionsPageState extends State<AllCollectionsPage>
_allCollections = List.from(collections);
_sortedCollections = List.from(regularCollections);
_uncategorizedCollection =
- widget.viewType == CollectionViewType.homeCollections
+ widget.viewType == UISectionType.homeCollections
? uncategorized
: null;
_uncategorizedFileCount = uncategorized != null &&
- widget.viewType == CollectionViewType.homeCollections
+ widget.viewType == UISectionType.homeCollections
? (await CollectionService.instance
.getFilesInCollection(uncategorized))
.length
@@ -437,11 +437,11 @@ class _AllCollectionsPageState extends State<AllCollectionsPage>
String _getTitle(BuildContext context) {
switch (widget.viewType) {
- case CollectionViewType.homeCollections:
+ case UISectionType.homeCollections:
return context.l10n.collections;
- case CollectionViewType.outgoingCollections:
+ case UISectionType.outgoingCollections:
return context.l10n.sharedByYou;
- case CollectionViewType.incomingCollections:
+ case UISectionType.incomingCollections:
return context.l10n.sharedWithYou;
}
}
diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dart
index db177167e9..4a9c82e685 100644
--- a/mobile/apps/locker/lib/ui/pages/home_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart
@@ -505,19 +505,19 @@ class _HomePageState extends UploaderPageState<HomePage>
..._buildCollectionSection(
title: context.l10n.collections,
collections: _displayedCollections,
- viewType: CollectionViewType.homeCollections,
+ viewType: UISectionType.homeCollections,
),
if (outgoingCollections.isNotEmpty)
..._buildCollectionSection(
title: context.l10n.sharedByYou,
collections: outgoingCollections,
- viewType: CollectionViewType.outgoingCollections,
+ viewType: UISectionType.outgoingCollections,
),
if (incomingCollections.isNotEmpty)
..._buildCollectionSection(
title: context.l10n.sharedWithYou,
collections: incomingCollections,
- viewType: CollectionViewType.incomingCollections,
+ viewType: UISectionType.incomingCollections,
),
_buildRecentsSection(),
],
@@ -737,7 +737,7 @@ class _HomePageState extends UploaderPageState<HomePage>
List<Widget> _buildCollectionSection({
required String title,
required List<Collection> collections,
- required CollectionViewType viewType,
+ required UISectionType viewType,
}) {
return [
SectionOptions(