A website inspired by Last.fm that will keep track of your listening statistics
lastfm music statistics
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rename inertia partial request functions to be more generic

oscar345 c1ea0343 7e718a7b

+6 -6
+1 -1
pkg/inertia/prop.go
··· 24 24 } 25 25 26 26 func (p *Prop) IsReturned(r *http.Request, key string, only []string, except []string) bool { 27 - isFirstLoad := !isInertiaPartialRequest(r) 27 + isFirstLoad := !isPartialRequest(r) 28 28 29 29 if isFirstLoad && p.Deferred { 30 30 return false
+3 -3
pkg/inertia/request.go
··· 20 20 return r.Header.Get(string(InertiaHeader)) == "true" 21 21 } 22 22 23 - func getInertiaPartialOnlyProps(r *http.Request) []string { 23 + func getPartialOnlyProps(r *http.Request) []string { 24 24 return strings.Split(r.Header.Get(string(InertiaPartialDataHeader)), ",") 25 25 } 26 26 27 - func getInertiaPartialExceptProps(r *http.Request) []string { 27 + func getPartialExceptProps(r *http.Request) []string { 28 28 return strings.Split(r.Header.Get(string(InertiaPartialExceptHeader)), ",") 29 29 } 30 30 31 - func isInertiaPartialRequest(r *http.Request) bool { 31 + func isPartialRequest(r *http.Request) bool { 32 32 return r.Header.Get(string(InertiaPartialComponentHeader)) != "" 33 33 }
+2 -2
pkg/inertia/response.go
··· 13 13 errors = make(map[string][]string) 14 14 ) 15 15 16 - only := getInertiaPartialOnlyProps(r) 17 - except := getInertiaPartialExceptProps(r) 16 + only := getPartialOnlyProps(r) 17 + except := getPartialExceptProps(r) 18 18 19 19 if contextProps, ok := r.Context().Value(PropsCtxKey).(Props); contextProps != nil && ok { 20 20 maps.Copy(contextProps, props)