Skip to content

armgit / ente

Public Imported from GitHub
0

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

normalize referral code input handling

AmanRajSinghMouryaa9d5af278760
diff --git a/mobile/apps/photos/lib/ui/growth/referral_code_widget.dart b/mobile/apps/photos/lib/ui/growth/referral_code_widget.dart
index 702f34d7f8..60345acc12 100644
--- a/mobile/apps/photos/lib/ui/growth/referral_code_widget.dart
+++ b/mobile/apps/photos/lib/ui/growth/referral_code_widget.dart
@@ -84,14 +84,14 @@ class _ReferralCodeWidgetState extends State<ReferralCodeWidget> {
});
}
- String get _trimmedInput => _controller.text.trim();
+ String get _normalizedInput => _controller.text.trim().toUpperCase();
bool get _canSave {
- final input = _trimmedInput;
+ final input = _normalizedInput;
return !_isSaving &&
_errorText == null &&
input.length >= 4 &&
- input != widget.code;
+ input != widget.code.trim().toUpperCase();
}
void _handleEditTap() {
@@ -122,7 +122,7 @@ class _ReferralCodeWidgetState extends State<ReferralCodeWidget> {
if (!_canSave) {
return;
}
- final newCode = _trimmedInput.toUpperCase();
+ final newCode = _normalizedInput;
setState(() {
_isSaving = true;
});