瀏覽代碼

Fix discover bug

Daniel Supernault 6 年之前
父節點
當前提交
ff860c9b85
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app/Http/Controllers/DiscoverController.php

+ 4 - 1
app/Http/Controllers/DiscoverController.php

@@ -29,7 +29,10 @@ class DiscoverController extends Controller
                   ->whereIn('filter_type', ['mute', 'block'])
                   ->whereIn('filter_type', ['mute', 'block'])
                   ->pluck('filterable_id');
                   ->pluck('filterable_id');
         $following->push($pid);
         $following->push($pid);
-        $following->push($filtered);
+        
+        if($filtered->count() > 0) {
+          $following->push($filtered);
+        }
 
 
         $people = Profile::inRandomOrder()
         $people = Profile::inRandomOrder()
           ->whereNotIn('id', $following)
           ->whereNotIn('id', $following)