mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 21:43:17 +00:00
Merge pull request #876 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
204e2830c9
2 changed files with 8 additions and 3 deletions
|
@ -8,7 +8,7 @@ use App\{
|
||||||
Profile,
|
Profile,
|
||||||
UserFilter
|
UserFilter
|
||||||
};
|
};
|
||||||
use Auth;
|
use Auth, Cache;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Jobs\FollowPipeline\FollowPipeline;
|
use App\Jobs\FollowPipeline\FollowPipeline;
|
||||||
|
|
||||||
|
@ -67,5 +67,8 @@ class FollowerController extends Controller
|
||||||
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail();
|
$follower = Follower::whereProfileId($user->id)->whereFollowingId($target->id)->firstOrFail();
|
||||||
$follower->delete();
|
$follower->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Cache::forget('profile:followers:'.$target->id);
|
||||||
|
Cache::forget('profile:following:'.$user->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,8 +305,10 @@ class PublicApiController extends Controller
|
||||||
// $timeline = Timeline::build()->local();
|
// $timeline = Timeline::build()->local();
|
||||||
$pid = Auth::user()->profile->id;
|
$pid = Auth::user()->profile->id;
|
||||||
|
|
||||||
$following = Follower::whereProfileId($pid)->pluck('following_id');
|
$following = Cache::remember('profile:following:'.$pid, 1440, function() use($pid) {
|
||||||
$following->push($pid)->toArray();
|
$following = Follower::whereProfileId($pid)->pluck('following_id');
|
||||||
|
return $following->push($pid)->toArray();
|
||||||
|
});
|
||||||
|
|
||||||
$private = Profile::whereIsPrivate(true)->orWhereNotNull('status')->where('id', '!=', $pid)->pluck('id');
|
$private = Profile::whereIsPrivate(true)->orWhereNotNull('status')->where('id', '!=', $pid)->pluck('id');
|
||||||
$filters = UserFilter::whereUserId($pid)
|
$filters = UserFilter::whereUserId($pid)
|
||||||
|
|
Loading…
Reference in a new issue