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,15 +5,16 @@ component ActivityFeed(entries []arn.Activity, nextIndex int, user *arn.User)
|
||||
Tab("Posts", "comment", "/activity")
|
||||
Tab("Watch", "eye", "/activity/watch")
|
||||
|
||||
.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")
|
||||
Icon("toggle-on")
|
||||
span Followed
|
||||
else
|
||||
button.action(id="Activity.ShowFollowedOnly", data-action="enable", data-trigger="click", data-field="Activity.ShowFollowedOnly", title="Followed only")
|
||||
Icon("toggle-off")
|
||||
span Followed
|
||||
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")
|
||||
Icon("toggle-on")
|
||||
span Followed
|
||||
else
|
||||
button.action(id="Activity.ShowFollowedOnly", data-action="enable", data-trigger="click", data-field="Activity.ShowFollowedOnly", title="Followed only")
|
||||
Icon("toggle-off")
|
||||
span Followed
|
||||
|
||||
if len(entries) == 0
|
||||
p.no-data.mountable No activity here.
|
||||
|
Loading…
Reference in New Issue
Block a user