Merge pull request #698 from ente-io/remove_feature_flag
Remove feature flag for collect + bump version
This commit is contained in:
commit
adb0368de4
4 changed files with 28 additions and 56 deletions
|
@ -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';
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -12,7 +12,7 @@ description: ente photos application
|
|||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
|
||||
version: 0.6.72+392
|
||||
version: 0.6.74+394
|
||||
|
||||
environment:
|
||||
sdk: '>=2.17.0 <3.0.0'
|
||||
|
|
Loading…
Add table
Reference in a new issue