Fixed activity page for anonymous access
This commit is contained in:
parent
0f5f18db0c
commit
74d8f46b08
@ -21,7 +21,7 @@ func Watch(ctx aero.Context) error {
|
||||
|
||||
// fetchCreateActivities filters the activities by the given filters.
|
||||
func fetchCreateActivities(user *arn.User) []arn.Activity {
|
||||
followedOnly := user.Settings().Activity.ShowFollowedOnly
|
||||
followedOnly := user != nil && user.Settings().Activity.ShowFollowedOnly
|
||||
|
||||
activities := arn.FilterActivityCreates(func(activity arn.Activity) bool {
|
||||
if followedOnly && user != nil && !user.IsFollowing(activity.GetCreatedBy()) {
|
||||
@ -48,7 +48,7 @@ func fetchCreateActivities(user *arn.User) []arn.Activity {
|
||||
|
||||
// fetchConsumeActivities filters the consume activities by the given filters.
|
||||
func fetchConsumeActivities(user *arn.User) []arn.Activity {
|
||||
followedOnly := user.Settings().Activity.ShowFollowedOnly
|
||||
followedOnly := user != nil && user.Settings().Activity.ShowFollowedOnly
|
||||
|
||||
activities := arn.FilterActivitiesConsumeAnime(func(activity arn.Activity) bool {
|
||||
if followedOnly && user != nil && !user.IsFollowing(activity.GetCreatedBy()) {
|
||||
|
@ -5,6 +5,7 @@ component ActivityFeed(entries []arn.Activity, nextIndex int, user *arn.User)
|
||||
Tab("Posts", "comment", "/activity")
|
||||
Tab("Watch", "eye", "/activity/watch")
|
||||
|
||||
if user != nil
|
||||
.corner-buttons(data-api="/api/settings/" + user.ID)
|
||||
if user.Settings().Activity.ShowFollowedOnly
|
||||
button.action(id="Activity.ShowFollowedOnly", data-action="disable", data-trigger="click", data-field="Activity.ShowFollowedOnly", title="Followed only")
|
||||
|
Loading…
Reference in New Issue
Block a user