diff --git a/lib/settings/pages/general_settings_page.dart b/lib/settings/pages/general_settings_page.dart index bd5420970..8301327f5 100644 --- a/lib/settings/pages/general_settings_page.dart +++ b/lib/settings/pages/general_settings_page.dart @@ -368,7 +368,6 @@ class _GeneralSettingsPageState extends State with SingleTi description: l10n.defaultFeedType, value: ListPickerItem(label: defaultListingType.value, icon: Icons.feed, payload: defaultListingType), options: [ - ListPickerItem(icon: Icons.view_list_rounded, label: ListingType.subscribed.value, payload: ListingType.subscribed), ListPickerItem(icon: Icons.home_rounded, label: ListingType.all.value, payload: ListingType.all), ListPickerItem(icon: Icons.grid_view_rounded, label: ListingType.local.value, payload: ListingType.local), ], diff --git a/lib/utils/preferences.dart b/lib/utils/preferences.dart index 42e4244a9..9ec47e8fa 100644 --- a/lib/utils/preferences.dart +++ b/lib/utils/preferences.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; +import 'package:lemmy_api_client/v3.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:thunder/account/models/draft.dart'; import 'package:thunder/comment/view/create_comment_page.dart'; @@ -11,6 +12,7 @@ import 'package:thunder/core/enums/local_settings.dart'; import 'package:thunder/drafts/draft_type.dart'; import 'package:thunder/notification/enums/notification_type.dart'; import 'package:thunder/core/singletons/preferences.dart'; +import 'package:thunder/utils/constants.dart'; Future performSharedPreferencesMigration() async { final SharedPreferences prefs = (await UserPreferences.instance).sharedPreferences; @@ -106,4 +108,10 @@ Future performSharedPreferencesMigration() async { debugPrint('Cannot migrate draft from SharedPreferences: $draftKey'); } } + + // Update the default feed type setting + ListingType defaultListingType = ListingType.values.byName(prefs.getString(LocalSettings.defaultFeedListingType.name) ?? DEFAULT_LISTING_TYPE.name); + if (defaultListingType == ListingType.subscribed) { + await prefs.setString(LocalSettings.defaultFeedListingType.name, DEFAULT_LISTING_TYPE.name); + } }