mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:18:52 +00:00
remove cursor logic from ToLinkURL()
This commit is contained in:
parent
eeb3e8bc60
commit
d099403a22
1 changed files with 6 additions and 19 deletions
|
@ -283,27 +283,14 @@ func (p *Page) ToLinkURL(proto, host, path string, queryParams url.Values) *url.
|
|||
queryParams = cloneQuery(queryParams)
|
||||
}
|
||||
|
||||
var cursor string
|
||||
|
||||
// Depending on page ordering, the
|
||||
// page will be cursored by either
|
||||
// the min or max query parameter.
|
||||
if p.order().Ascending() {
|
||||
cursor = p.Min.Name
|
||||
} else {
|
||||
cursor = p.Max.Name
|
||||
if p.Min.Value != "" {
|
||||
// Set page-minimum cursor value.
|
||||
queryParams.Set(p.Min.Name, p.Min.Value)
|
||||
}
|
||||
|
||||
if cursor != "" {
|
||||
if p.Min.Value != "" {
|
||||
// Set page-minimum cursor value.
|
||||
queryParams.Set(cursor, p.Min.Value)
|
||||
}
|
||||
|
||||
if p.Max.Value != "" {
|
||||
// Set page-maximum cursor value.
|
||||
queryParams.Set(cursor, p.Max.Value)
|
||||
}
|
||||
if p.Max.Value != "" {
|
||||
// Set page-maximum cursor value.
|
||||
queryParams.Set(p.Max.Name, p.Max.Value)
|
||||
}
|
||||
|
||||
if p.Limit > 0 {
|
||||
|
|
Loading…
Reference in a new issue