Skip to content

armgit / ente

Public Imported from GitHub
0

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

Restore crash reporting toggle and fix no-mail sheet overflow

ashilknb8be7c4efdcd
diff --git a/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart b/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart
index 8fc00dddc5..5eb6bd4333 100644
--- a/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart
+++ b/mobile/apps/photos/lib/ui/settings/security/security_settings_page.dart
@@ -8,6 +8,7 @@ import "package:hugeicons/hugeicons.dart";
import "package:local_auth/local_auth.dart";
import "package:logging/logging.dart";
import "package:photos/core/configuration.dart";
+import "package:photos/core/error-reporting/super_logging.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/user_details_changed_event.dart";
import "package:photos/generated/l10n.dart";
@@ -123,6 +124,25 @@ class _SecuritySettingsPageState extends State<SecuritySettingsPage> {
),
),
const SizedBox(height: 8),
+ MenuItemWidgetNew(
+ title: AppLocalizations.of(context).crashReporting,
+ leadingIconWidget: _buildIconWidget(
+ context,
+ HugeIcons.strokeRoundedBug02,
+ ),
+ trailingWidget: ToggleSwitchWidget(
+ value: () => SuperLogging.shouldReportCrashes(),
+ onChanged: () async {
+ await SuperLogging.setShouldReportCrashes(
+ !SuperLogging.shouldReportCrashes(),
+ );
+ if (mounted) {
+ setState(() {});
+ }
+ },
+ ),
+ ),
+ const SizedBox(height: 8),
MenuItemWidgetNew(
title: context.l10n.passkey,
leadingIconWidget: _buildIconWidget(
@@ -145,7 +165,7 @@ class _SecuritySettingsPageState extends State<SecuritySettingsPage> {
trailingIconIsMuted: true,
onTap: () async => _onAppLockTap(context),
),
- const SizedBox(height: 8),
+ if (showAccountSecurity) const SizedBox(height: 8),
if (showAccountSecurity)
MenuItemWidgetNew(
title: AppLocalizations.of(context).activeSessions,
diff --git a/mobile/apps/photos/lib/ui/settings/support/no_mail_app_sheet.dart b/mobile/apps/photos/lib/ui/settings/support/no_mail_app_sheet.dart
index 80a42c3275..498f87a20c 100644
--- a/mobile/apps/photos/lib/ui/settings/support/no_mail_app_sheet.dart
+++ b/mobile/apps/photos/lib/ui/settings/support/no_mail_app_sheet.dart
@@ -74,47 +74,69 @@ class NoMailAppSheet extends StatelessWidget {
note: l10n.logsNotCopiedDownloadNote,
),
];
+ final maxSheetBodyHeight = MediaQuery.sizeOf(context).height * 0.75;
+ final estimatedSheetBodyHeight = 240 + (120 * copyFields.length);
+ final sheetBodyHeight = estimatedSheetBodyHeight > maxSheetBodyHeight
+ ? maxSheetBodyHeight
+ : estimatedSheetBodyHeight.toDouble();
- return Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- l10n.noEmailAppBody(email: toEmail),
- style: getEnteTextTheme(context).smallMuted,
- ),
- const SizedBox(height: 16),
- for (int i = 0; i < copyFields.length; i++) ...[
- _CopyField(
- data: copyFields[i],
- onCopy: () async {
- await Clipboard.setData(ClipboardData(text: copyFields[i].value));
+ return SizedBox(
+ height: sheetBodyHeight,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Expanded(
+ child: SingleChildScrollView(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ l10n.noEmailAppBody(email: toEmail),
+ style: getEnteTextTheme(context).smallMuted,
+ ),
+ const SizedBox(height: 16),
+ for (int i = 0; i < copyFields.length; i++) ...[
+ _CopyField(
+ data: copyFields[i],
+ onCopy: () async {
+ await Clipboard.setData(
+ ClipboardData(text: copyFields[i].value),
+ );
+ if (context.mounted) {
+ showShortToast(context, l10n.copied);
+ }
+ },
+ onExport: copyFields[i].logsFilePath == null
+ ? null
+ : () async {
+ await exportLogs(
+ context,
+ copyFields[i].logsFilePath!,
+ );
+ },
+ ),
+ if (i != copyFields.length - 1) const SizedBox(height: 12),
+ ],
+ ],
+ ),
+ ),
+ ),
+ const SizedBox(height: 16),
+ ButtonWidgetV2(
+ buttonType: ButtonTypeV2.primary,
+ labelText: l10n.copyAllToClipboard,
+ onTap: () async {
+ await Clipboard.setData(
+ ClipboardData(text: _buildCopyAllPayload(l10n)),
+ );
if (context.mounted) {
showShortToast(context, l10n.copied);
}
},
- onExport: copyFields[i].logsFilePath == null
- ? null
- : () async {
- await exportLogs(context, copyFields[i].logsFilePath!);
- },
),
- if (i != copyFields.length - 1) const SizedBox(height: 12),
],
- const SizedBox(height: 16),
- ButtonWidgetV2(
- buttonType: ButtonTypeV2.primary,
- labelText: l10n.copyAllToClipboard,
- onTap: () async {
- await Clipboard.setData(
- ClipboardData(text: _buildCopyAllPayload(l10n)),
- );
- if (context.mounted) {
- showShortToast(context, l10n.copied);
- }
- },
- ),
- ],
+ ),
);
}