back interdiff of round #2 and #1

appview: implement follower and following pages for users #484

merged
opened by ptr.pet targeting master from [deleted fork]: followers-following-list
ERROR
appview/pages/funcmap.go

Failed to calculate interdiff for this file.

REBASED
appview/pages/pages.go

This patch was likely rebased, as context lines do not match.

ERROR
appview/pages/templates/user/followers.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/following.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/fragments/follow.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/fragments/followCard.html

Failed to calculate interdiff for this file.

ERROR
appview/pages/templates/user/fragments/profileCard.html

Failed to calculate interdiff for this file.

REBASED
appview/state/profile.go

This patch was likely rebased, as context lines do not match.

ERROR
appview/state/router.go

Failed to calculate interdiff for this file.

ERROR
appview/strings/strings.go

Failed to calculate interdiff for this file.

NEW
appview/db/profile.go
··· 348 348 return tx.Commit() 349 349 } 350 350 351 - func GetProfiles(e Execer, filters ...filter) ([]Profile, error) { 351 + func GetProfiles(e Execer, filters ...filter) (map[string]*Profile, error) { 352 352 var conditions []string 353 353 var args []any 354 354 for _, filter := range filters { ··· 448 448 idxs[did] = idx + 1 449 449 } 450 450 451 - var profiles []Profile 452 - for _, p := range profileMap { 453 - profiles = append(profiles, *p) 454 - } 455 - 456 - return profiles, nil 451 + return profileMap, nil 457 452 } 458 453 459 454 func GetProfile(e Execer, did string) (*Profile, error) {
NEW
appview/db/timeline.go
··· 151 151 return nil, nil 152 152 } 153 153 154 - profileMap := make(map[string]Profile) 155 154 profiles, err := GetProfiles(e, FilterIn("did", subjects)) 156 155 if err != nil { 157 156 return nil, err 158 157 } 159 - for _, p := range profiles { 160 - profileMap[p.Did] = p 161 - } 162 158 163 159 followStatMap := make(map[string]FollowStats) 164 160 for _, s := range subjects { ··· 174 170 175 171 var events []TimelineEvent 176 172 for _, f := range follows { 177 - profile, _ := profileMap[f.SubjectDid] 173 + profile, _ := profiles[f.SubjectDid] 178 174 followStatMap, _ := followStatMap[f.SubjectDid] 179 175 180 176 events = append(events, TimelineEvent{ 181 177 Follow: &f, 182 - Profile: &profile, 178 + Profile: profile, 183 179 FollowStats: &followStatMap, 184 180 EventAt: f.FollowedAt, 185 181 })