1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-15 08:42:48 -05:00

Implement proper infinite scroll for replies

Fixes #125
This commit is contained in:
Zed
2020-04-29 18:09:13 +02:00
parent d20cddd15f
commit c6215876fa
9 changed files with 102 additions and 44 deletions

View File

@@ -1,6 +1,6 @@
import asyncdispatch, strutils, sequtils, uri, options
import jester
import jester, karax/vdom
import router_utils
import ".."/[api, types, formatters, agents]
@@ -17,6 +17,10 @@ proc createStatusRouter*(cfg: Config) =
cond '.' notin @"name"
let prefs = cookiePrefs()
if @"scroll".len > 0:
let replies = await getReplies(@"name", @"id", @"max_position", getAgent())
resp $renderReplies(replies, prefs, getPath())
let conversation = await getTweet(@"name", @"id", @"max_position", getAgent())
if conversation == nil or conversation.tweet.id == 0:
var error = "Tweet not found"