Simplify query parameters

This commit is contained in:
Zed 2019-09-21 01:11:03 +02:00
parent 9e3138e51b
commit ac9fa2ce1d
2 changed files with 4 additions and 2 deletions

View file

@ -93,7 +93,7 @@ proc genQueryUrl*(query: Query): string =
params.add "f-" & f & "=on"
for e in query.excludes:
params.add "e-" & e & "=on"
for i in query.includes:
for i in query.includes.filterIt(it != "nativeretweets"):
params.add "i-" & i & "=on"
if query.since.len > 0:

View file

@ -11,8 +11,10 @@ proc getQuery(query: Query): string =
result &= "&"
proc renderNewer(query: Query; path: string): VNode =
let q = genQueryUrl(query)
let url = if q.len > 0: "?" & q else: ""
buildHtml(tdiv(class="timeline-item show-more")):
a(href=(&"{path}?{genQueryUrl(query)}")):
a(href=(path & url)):
text "Load newest"
proc renderMore(query: Query; minId: string): VNode =