Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Keep showing of magic examples on search tab behind feature flag

ashilkn7fdf52309ae7
diff --git a/mobile/lib/services/search_service.dart b/mobile/lib/services/search_service.dart
index 1ac46c5faf..e55684ed9b 100644
--- a/mobile/lib/services/search_service.dart
+++ b/mobile/lib/services/search_service.dart
@@ -27,6 +27,7 @@ import 'package:photos/models/search/album_search_result.dart';
import 'package:photos/models/search/generic_search_result.dart';
import "package:photos/models/search/search_constants.dart";
import "package:photos/models/search/search_types.dart";
+import "package:photos/service_locator.dart";
import 'package:photos/services/collections_service.dart';
import "package:photos/services/location_service.dart";
import "package:photos/services/machine_learning/face_ml/face_filtering/face_filtering_constants.dart";
@@ -62,7 +63,9 @@ class SearchService {
_cachedFilesFuture = null;
_cachedHiddenFilesFuture = null;
});
- _loadMagicPrompts();
+ if (flagService.internalUser) {
+ _loadMagicPrompts();
+ }
}
Future<dynamic> _loadMagicPrompts() async {
diff --git a/mobile/lib/ui/viewer/search_tab/magic_section.dart b/mobile/lib/ui/viewer/search_tab/magic_section.dart
index 200f2b988d..d088de92e5 100644
--- a/mobile/lib/ui/viewer/search_tab/magic_section.dart
+++ b/mobile/lib/ui/viewer/search_tab/magic_section.dart
@@ -13,7 +13,6 @@ import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
import "package:photos/ui/viewer/file/thumbnail_widget.dart";
import "package:photos/ui/viewer/search/result/search_result_page.dart";
-import "package:photos/ui/viewer/search/search_section_cta.dart";
import "package:photos/ui/viewer/search_tab/section_header.dart";
import "package:photos/utils/navigation_util.dart";
@@ -94,35 +93,36 @@ class _MagicSectionState extends State<MagicSection> {
@override
Widget build(BuildContext context) {
if (_magicSearchResults.isEmpty) {
- final textTheme = getEnteTextTheme(context);
- return Padding(
- padding: const EdgeInsets.only(left: 12, right: 8),
- child: Row(
- children: [
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- SectionType.magic.sectionTitle(context),
- style: textTheme.largeBold,
- ),
- const SizedBox(height: 24),
- Padding(
- padding: const EdgeInsets.only(left: 4),
- child: Text(
- SectionType.magic.getEmptyStateText(context),
- style: textTheme.smallMuted,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(width: 8),
- const SearchSectionEmptyCTAIcon(SectionType.magic),
- ],
- ),
- );
+ // final textTheme = getEnteTextTheme(context);
+ // return Padding(
+ // padding: const EdgeInsets.only(left: 12, right: 8),
+ // child: Row(
+ // children: [
+ // Expanded(
+ // child: Column(
+ // crossAxisAlignment: CrossAxisAlignment.start,
+ // children: [
+ // Text(
+ // SectionType.magic.sectionTitle(context),
+ // style: textTheme.largeBold,
+ // ),
+ // const SizedBox(height: 24),
+ // Padding(
+ // padding: const EdgeInsets.only(left: 4),
+ // child: Text(
+ // SectionType.magic.getEmptyStateText(context),
+ // style: textTheme.smallMuted,
+ // ),
+ // ),
+ // ],
+ // ),
+ // ),
+ // const SizedBox(width: 8),
+ // const SearchSectionEmptyCTAIcon(SectionType.magic),
+ // ],
+ // ),
+ // );
+ return const SizedBox.shrink();
} else {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),