Skip to content

Commit 95ae346

Browse files
committed
Change filter labels.
Disable filter when not logged in.
1 parent ef8a6f6 commit 95ae346

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

lib/src/screens/explore/explore_screen.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class _ExploreScreenState extends State<ExploreScreen> {
5757

5858
APIExploreSort sort = APIExploreSort.hot;
5959
ExploreFilter filter = ExploreFilter.all;
60-
FeedFilter feedFilter = FeedFilter.all;
60+
FeedFilter feedFilter = FeedFilter.public;
6161

6262
late final _pagingController = AdvancedPagingController<String, dynamic, int>(
6363
logger: context.read<AppController>().logger,
@@ -112,7 +112,7 @@ class _ExploreScreenState extends State<ExploreScreen> {
112112
case ExploreType.feeds:
113113
case ExploreType.topics:
114114
final newPage = await ac.api.feed.list(
115-
mineOnly: feedFilter == FeedFilter.mine,
115+
mineOnly: feedFilter == FeedFilter.personal,
116116
topics: type == ExploreType.topics,
117117
includeCommunities: true,
118118
);
@@ -390,7 +390,9 @@ class _ExploreScreenState extends State<ExploreScreen> {
390390
onPressed:
391391
ac.serverSoftware == ServerSoftware.mbin &&
392392
type == ExploreType.all ||
393-
type == ExploreType.topics
393+
type == ExploreType.topics ||
394+
(type == ExploreType.feeds &&
395+
(whenLoggedIn(context, false) ?? true))
394396
? null
395397
: type == ExploreType.feeds
396398
? () async {
@@ -594,17 +596,17 @@ SelectionMenu<ExploreFilter> exploreFilterSelection(
594596
[]),
595597
]);
596598

597-
enum FeedFilter { all, mine }
599+
enum FeedFilter { public, personal }
598600

599601
SelectionMenu<FeedFilter> feedFilterSelection(BuildContext context) =>
600602
SelectionMenu(l(context).sort, [
601603
SelectionMenuItem(
602-
value: FeedFilter.all,
603-
title: l(context).filter_allResults,
604+
value: FeedFilter.public,
605+
title: l(context).public,
604606
icon: Symbols.newspaper_rounded,
605607
),
606608
SelectionMenuItem(
607-
value: FeedFilter.mine,
609+
value: FeedFilter.personal,
608610
title: l(context).filter_personal,
609611
icon: Symbols.home_rounded,
610612
),

0 commit comments

Comments
 (0)