diff --git a/app/Http/Controllers/GroupController.php b/app/Http/Controllers/GroupController.php index 0169547e2a..5717ecd64f 100644 --- a/app/Http/Controllers/GroupController.php +++ b/app/Http/Controllers/GroupController.php @@ -62,13 +62,11 @@ private function indexVariations($tab, $network) ->select($group_atts) ->get(); - //Make sure we don't show the same groups in nearest to you - $your_groups_uniques = $your_groups->pluck('idgroups')->toArray(); - $groups_near_you = $user->groupsNearby(10); + // We pass a high limit to the groups nearby; there is a distance limit which will normally kick in first. + $groups_near_you = $user->groupsNearby(1000); return view('group.index', [ 'your_groups' => $this->expandGroups($your_groups), - 'your_groups_uniques' => $your_groups_uniques, 'groups_near_you' => $this->expandGroups($groups_near_you), 'groups' => $this->expandGroups($groups), 'your_area' => $user->location, @@ -830,6 +828,7 @@ private function expandGroups($groups) 'networks' => Arr::pluck($group->networks, 'id'), 'country' => $group->country, 'group_tags' => $group->group_tags()->get()->pluck('id'), + 'distance' => $group->distance ]; } } diff --git a/resources/js/components/GroupsPage.vue b/resources/js/components/GroupsPage.vue index f97ed5314f..0c32349896 100644 --- a/resources/js/components/GroupsPage.vue +++ b/resources/js/components/GroupsPage.vue @@ -43,6 +43,10 @@ {{ __('groups.groups_title2') }}
+

+ {{ nearestGroups }} + {{ __('groups.nearest_groups_change') }}. +