From eba562daead47fd305a8570713ff16a00064de23 Mon Sep 17 00:00:00 2001 From: Hamlet Jiang Su Date: Thu, 11 Jan 2024 10:01:59 -0800 Subject: [PATCH 1/4] fix issue with default locale being arabic when not --- lib/thunder/bloc/thunder_bloc.dart | 2 +- lib/thunder/bloc/thunder_state.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/thunder/bloc/thunder_bloc.dart b/lib/thunder/bloc/thunder_bloc.dart index 091210f51..8131e6fba 100644 --- a/lib/thunder/bloc/thunder_bloc.dart +++ b/lib/thunder/bloc/thunder_bloc.dart @@ -110,7 +110,7 @@ class ThunderBloc extends Bloc { bool useDisplayNames = prefs.getBool(LocalSettings.useDisplayNamesForUsers.name) ?? true; bool markPostReadOnMediaView = prefs.getBool(LocalSettings.markPostAsReadOnMediaView.name) ?? false; bool showInAppUpdateNotification = prefs.getBool(LocalSettings.showInAppUpdateNotification.name) ?? false; - String? appLanguageCode = prefs.getString(LocalSettings.appLanguageCode.name); + String? appLanguageCode = prefs.getString(LocalSettings.appLanguageCode.name) ?? 'en'; FullNameSeparator userSeparator = FullNameSeparator.values.byName(prefs.getString(LocalSettings.userFormat.name) ?? FullNameSeparator.at.name); FullNameSeparator communitySeparator = FullNameSeparator.values.byName(prefs.getString(LocalSettings.communityFormat.name) ?? FullNameSeparator.dot.name); diff --git a/lib/thunder/bloc/thunder_state.dart b/lib/thunder/bloc/thunder_state.dart index b12bca56e..288825ba1 100644 --- a/lib/thunder/bloc/thunder_state.dart +++ b/lib/thunder/bloc/thunder_state.dart @@ -54,7 +54,7 @@ class ThunderState extends Equatable { this.useAdvancedShareSheet = true, this.showCrossPosts = true, this.keywordFilters = const [], - this.appLanguageCode, + this.appLanguageCode = 'en', /// -------------------------- Post Page Related Settings -------------------------- this.disablePostFabs = false, @@ -311,7 +311,7 @@ class ThunderState extends Equatable { bool? dimReadPosts, bool? useAdvancedShareSheet, bool? showCrossPosts, - String? appLanguageCode, + String? appLanguageCode = 'en', List? keywordFilters, /// -------------------------- Post Page Related Settings -------------------------- From 27b727c36a69e23419d2e0f52e2b914aa740ae7a Mon Sep 17 00:00:00 2001 From: Hamlet Jiang Su Date: Thu, 11 Jan 2024 10:11:45 -0800 Subject: [PATCH 2/4] updated version --- lib/globals.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/globals.dart b/lib/globals.dart index 3504fcbb8..a79a63610 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -1 +1 @@ -const String currentVersion = '0.2.7+35'; +const String currentVersion = '0.2.8+36'; diff --git a/pubspec.yaml b/pubspec.yaml index 6ad2056b7..5dc262a93 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: thunder description: An open-source cross-platform Lemmy client for iOS and Android built with Flutter publish_to: "none" -version: 0.2.7+35 +version: 0.2.8+36 environment: sdk: "^3.0.0" From 3dd90d5dcf967e7f35488d22605895b10c354da7 Mon Sep 17 00:00:00 2001 From: Hamlet Jiang Su <30667958+hjiangsu@users.noreply.github.com> Date: Thu, 11 Jan 2024 21:42:02 -0800 Subject: [PATCH 3/4] Added option to delete account from user settings page (#1041) * added option to delete account from user settings page * added padding at the bottom of user settings page --- lib/l10n/app_en.arb | 16 ++++++++++++ lib/user/pages/user_settings_page.dart | 35 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index a70cfb685..8ed4ab097 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -187,6 +187,10 @@ "@compactViewSettings": { "description": "Subcategory in Setting -> Appearance -> Posts" }, + "confirm": "Confirm", + "@confirm": { + "description": "Label for the confirm action in the dialog" + }, "confirmLogOutBody": "Are you sure you want to log out?", "@confirmLogOutBody": { "description": "The body of the confirm logout dialog" @@ -247,6 +251,10 @@ "@currentSinglePress": {}, "customizeSwipeActions": "Customize swipe actions (tap to change)", "@customizeSwipeActions": {}, + "dangerZone": "Danger Zone", + "@dangerZone": { + "description": "Describes a section where the actions could be dangerous (e.g., permanently deleting account)" + }, "debug": "Debug", "@debug": { "description": "Debug settings category." @@ -257,6 +265,14 @@ }, "delete": "Delete", "@delete": {}, + "deleteAccount": "Delete Account", + "@deleteAccount": { + "description": "Label for action to delete account" + }, + "deleteAccountDescription": "To permanently delete your account, you will be redirected to your instance site. \n\nAre you sure you want to continue?", + "@deleteAccountDescription": { + "description": "Description for confirmation action to delete account" + }, "deleteLocalDatabase": "Delete Local Database", "@deleteLocalDatabase": { "description": "Label for action to delete local database" diff --git a/lib/user/pages/user_settings_page.dart b/lib/user/pages/user_settings_page.dart index ea5045307..82e4cc63d 100644 --- a/lib/user/pages/user_settings_page.dart +++ b/lib/user/pages/user_settings_page.dart @@ -10,8 +10,10 @@ import 'package:thunder/core/auth/bloc/auth_bloc.dart'; import 'package:thunder/core/enums/full_name_separator.dart'; import 'package:thunder/core/singletons/lemmy_client.dart'; import 'package:thunder/feed/feed.dart'; +import 'package:thunder/settings/widgets/settings_list_tile.dart'; import 'package:thunder/settings/widgets/toggle_option.dart'; import 'package:thunder/shared/community_icon.dart'; +import 'package:thunder/shared/dialogs.dart'; import 'package:thunder/shared/input_dialogs.dart'; import 'package:thunder/shared/snackbar.dart'; import 'package:thunder/shared/user_avatar.dart'; @@ -19,6 +21,7 @@ import 'package:thunder/thunder/thunder_icons.dart'; import 'package:thunder/user/bloc/user_settings_bloc.dart'; import 'package:thunder/user/widgets/user_indicator.dart'; import 'package:thunder/utils/instance.dart'; +import 'package:thunder/utils/links.dart'; import 'package:thunder/utils/navigate_instance.dart'; import 'package:thunder/utils/navigate_user.dart'; @@ -250,6 +253,38 @@ class _UserSettingsPageState extends State { emptyText: l10n.noCommunityBlocks, items: getCommunityBlocks(context, state, state.communityBlocks), ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: Text(l10n.dangerZone, style: theme.textTheme.titleMedium), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: SettingsListTile( + icon: Icons.delete_forever_rounded, + description: l10n.deleteAccount, + widget: const SizedBox( + height: 42.0, + child: Icon(Icons.chevron_right_rounded), + ), + onTap: () async { + showThunderDialog( + context: context, + title: l10n.deleteAccount, + contentText: l10n.deleteAccountDescription, + onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), + secondaryButtonText: l10n.cancel, + onPrimaryButtonPressed: (dialogContext, _) async { + if (context.mounted) { + Navigator.of(context).pop(); + handleLink(context, url: 'https://${LemmyClient.instance.lemmyApiV3.host}/settings'); + } + }, + primaryButtonText: l10n.confirm, + ); + }, + ), + ), + const SizedBox(height: 100.0), ], ), ); From 6faacb8cc61409e616c4615fc0ccec3c6da65129 Mon Sep 17 00:00:00 2001 From: Hamlet Jiang Su Date: Fri, 12 Jan 2024 09:01:23 -0800 Subject: [PATCH 4/4] Bumped build number for App Store release --- lib/globals.dart | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/globals.dart b/lib/globals.dart index a79a63610..43ae0edc6 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -1 +1 @@ -const String currentVersion = '0.2.8+36'; +const String currentVersion = '0.2.8+37'; diff --git a/pubspec.yaml b/pubspec.yaml index 5dc262a93..c406bece4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: thunder description: An open-source cross-platform Lemmy client for iOS and Android built with Flutter publish_to: "none" -version: 0.2.8+36 +version: 0.2.8+37 environment: sdk: "^3.0.0"