Skip to content

Commit

Permalink
Remove option to show both followed tags & discussions
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed Oct 30, 2020
1 parent 4004627 commit 72d06ba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion js/src/common/utils/followingPageOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let opts;

export default (section) =>
opts ||
(opts = ['none', 'tags', 'all'].reduce((o, key) => {
(opts = ['none', 'tags'].reduce((o, key) => {
o[key] = app.translator.trans(`fof-follow-tags.${section}.following_${key}_label`);

return o;
Expand Down
3 changes: 0 additions & 3 deletions resources/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ fof-follow-tags:

following:
following_none_label: => fof-follow-tags.ref.filtering_options.none
following_all_label: => fof-follow-tags.ref.filtering_options.all
following_tags_label: => fof-follow-tags.ref.filtering_options.tags

badge:
Expand Down Expand Up @@ -53,7 +52,6 @@ fof-follow-tags:

following_none_label: => fof-follow-tags.ref.filtering_options.none
following_tags_label: => fof-follow-tags.ref.filtering_options.tags
following_all_label: => fof-follow-tags.ref.filtering_options.all


email:
Expand All @@ -70,5 +68,4 @@ fof-follow-tags:

filtering_options:
none: Followed Discussions
all: Everything You Follow
tags: Followed Tags
6 changes: 1 addition & 5 deletions src/Gambit/FollowTagsGambit.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ protected function conditions(AbstractSearch $search, array $matches, $negate)
return;
}

$includeFollowing = Arr::first($search->getActiveGambits(), function ($gambit) {
return $gambit instanceof SubscriptionGambit;
});

$search->getQuery()->{$includeFollowing ? 'orWhereExists' : 'whereExists'}(function ($query) use ($actor) {
$search->getQuery()->whereExists(function ($query) use ($actor) {
$tagIds = TagState::query()
->where('user_id', $actor->id)
->whereIn('subscription', ['lurk', 'follow'])
Expand Down

0 comments on commit 72d06ba

Please sign in to comment.