diff --git a/lib/pages/home_tab.dart b/lib/pages/home_tab.dart index b23c419..b74ac8d 100644 --- a/lib/pages/home_tab.dart +++ b/lib/pages/home_tab.dart @@ -25,10 +25,13 @@ class HomeTab extends HookWidget { @override Widget build(BuildContext context) { final accStore = useAccountsStore(); + final defaultListingType = + useConfigStoreSelect((configStore) => configStore.defaultListingType); final selectedList = useState(_SelectedList( - listingType: accStore.hasNoAccount + listingType: accStore.hasNoAccount && + defaultListingType == PostListingType.subscribed ? PostListingType.all - : PostListingType.subscribed)); + : defaultListingType)); final isc = useInfiniteScrollController(); final theme = Theme.of(context); final instancesIcons = useMemoFuture(() async { @@ -54,9 +57,10 @@ class HomeTab extends HookWidget { selectedList.value.listingType == PostListingType.subscribed || !accStore.instances.contains(selectedList.value.instanceHost)) { selectedList.value = _SelectedList( - listingType: accStore.hasNoAccount + listingType: accStore.hasNoAccount && + defaultListingType == PostListingType.subscribed ? PostListingType.all - : PostListingType.subscribed, + : defaultListingType, ); } diff --git a/lib/stores/config_store.dart b/lib/stores/config_store.dart index 4dd121e..471dc23 100644 --- a/lib/stores/config_store.dart +++ b/lib/stores/config_store.dart @@ -144,6 +144,5 @@ class ConfigStore extends ChangeNotifier { SortType _sortTypeFromJson(String? json) => json != null ? SortType.fromJson(json) : SortType.hot; -// String _sortType PostListingType _postListingTypeFromJson(String? json) => json != null ? PostListingType.fromJson(json) : PostListingType.all;