Jelajahi Sumber

remove feature flag

Neeraj Gupta 2 tahun lalu
induk
melakukan
9cf457a903

+ 0 - 1
lib/core/constants.dart

@@ -44,7 +44,6 @@ const supportEmail = 'support@ente.io';
 class FFDefault {
   static const bool enableStripe = true;
   static const bool disableCFWorker = false;
-  static const bool enableCollect = false;
 }
 
 const kDefaultProductionEndpoint = 'https://api.ente.io';

+ 0 - 17
lib/services/feature_flag_service.dart

@@ -62,18 +62,6 @@ class FeatureFlagService {
     }
   }
 
-  bool enableCollect() {
-    if (isInternalUserOrDebugBuild()) {
-      return true;
-    }
-    try {
-      return _getFeatureFlags().enableCollect;
-    } catch (e) {
-      _logger.severe(e);
-      return FFDefault.enableCollect;
-    }
-  }
-
   bool isInternalUserOrDebugBuild() {
     final String? email = Configuration.instance.getEmail();
     return (email != null && email.endsWith("@ente.io")) || kDebugMode;
@@ -97,24 +85,20 @@ class FeatureFlags {
   static FeatureFlags defaultFlags = FeatureFlags(
     disableCFWorker: FFDefault.disableCFWorker,
     enableStripe: FFDefault.enableStripe,
-    enableCollect: FFDefault.enableCollect,
   );
 
   final bool disableCFWorker;
   final bool enableStripe;
-  final bool enableCollect;
 
   FeatureFlags({
     required this.disableCFWorker,
     required this.enableStripe,
-    required this.enableCollect,
   });
 
   Map<String, dynamic> toMap() {
     return {
       "disableCFWorker": disableCFWorker,
       "enableStripe": enableStripe,
-      "enableCollect": enableCollect,
     };
   }
 
@@ -127,7 +111,6 @@ class FeatureFlags {
     return FeatureFlags(
       disableCFWorker: json["disableCFWorker"] ?? FFDefault.disableCFWorker,
       enableStripe: json["enableStripe"] ?? FFDefault.enableStripe,
-      enableCollect: json["enableCollect"] ?? FFDefault.enableCollect,
     );
   }
 }

+ 27 - 37
lib/ui/sharing/manage_links_widget.dart

@@ -10,7 +10,6 @@ import 'package:flutter_sodium/flutter_sodium.dart';
 import 'package:photos/ente_theme_data.dart';
 import 'package:photos/models/collection.dart';
 import 'package:photos/services/collections_service.dart';
-import 'package:photos/services/feature_flag_service.dart';
 import 'package:photos/theme/colors.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/common/dialogs.dart';
@@ -59,41 +58,6 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
   Widget build(BuildContext context) {
     final enteColorScheme = getEnteColorScheme(context);
     final PublicURL url = widget.collection?.publicURLs?.firstOrNull;
-    final enableCollectFeature = FeatureFlagService.instance.enableCollect();
-    final Widget collect = enableCollectFeature
-        ? Column(
-            crossAxisAlignment: CrossAxisAlignment.start,
-            children: [
-              MenuItemWidget(
-                captionedTextWidget: const CaptionedTextWidget(
-                  title: "Allow adding photos",
-                ),
-                alignCaptionedTextToLeft: true,
-                menuItemColor: getEnteColorScheme(context).fillFaint,
-                pressedColor: getEnteColorScheme(context).fillFaint,
-                trailingWidget: Switch.adaptive(
-                  value: widget
-                          .collection.publicURLs?.firstOrNull?.enableCollect ??
-                      false,
-                  onChanged: (value) async {
-                    await _updateUrlSettings(
-                      context,
-                      {'enableCollect': value},
-                    );
-
-                    setState(() {});
-                  },
-                ),
-              ),
-              const MenuSectionDescriptionWidget(
-                content:
-                    "Allow people with the link to also add photos to the shared "
-                    "album.",
-              ),
-              const SizedBox(height: 24)
-            ],
-          )
-        : const SizedBox.shrink();
     return Scaffold(
       backgroundColor: Theme.of(context).backgroundColor,
       appBar: AppBar(
@@ -110,7 +74,33 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
               child: Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: [
-                  collect,
+                  MenuItemWidget(
+                    captionedTextWidget: const CaptionedTextWidget(
+                      title: "Allow adding photos",
+                    ),
+                    alignCaptionedTextToLeft: true,
+                    menuItemColor: getEnteColorScheme(context).fillFaint,
+                    pressedColor: getEnteColorScheme(context).fillFaint,
+                    trailingWidget: Switch.adaptive(
+                      value: widget.collection.publicURLs?.firstOrNull?.enableCollect ??
+                          false,
+                      onChanged: (value) async {
+                        await _updateUrlSettings(
+                          context,
+                          {'enableCollect': value},
+                        );
+
+                        setState(() {});
+                      },
+                    ),
+                  ),
+                  const MenuSectionDescriptionWidget(
+                    content:
+                    "Allow people with the link to also add photos to the shared "
+                        "album.",
+                  ),
+                  const SizedBox(height: 24)
+                ],
                   MenuItemWidget(
                     alignCaptionedTextToLeft: true,
                     captionedTextWidget: CaptionedTextWidget(