소스 검색

Fix list members not displaying

jackyzy823 4 년 전
부모
커밋
9b97ddc8d8
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      src/api.nim

+ 4 - 3
src/api.nim

@@ -25,10 +25,9 @@ proc getGraphList*(id: string): Future[List] {.async.} =
 
 proc getGraphListMembers*(list: List; after=""): Future[Result[User]] {.async.} =
   if list.id.len == 0: return
-  let
+  var
     variables = %*{
       "listId": list.id,
-      "cursor": after,
       "withSuperFollowsUserFields": false,
       "withBirdwatchPivots": false,
       "withDownvotePerspective": false,
@@ -36,7 +35,9 @@ proc getGraphListMembers*(list: List; after=""): Future[Result[User]] {.async.}
       "withReactionsPerspective": false,
       "withSuperFollowsTweetFields": false
     }
-    url = graphListMembers ? {"variables": $variables}
+  if after.len > 0:
+    variables["cursor"] = % after
+  let url = graphListMembers ? {"variables": $variables}
   result = parseGraphListMembers(await fetchRaw(url, Api.listMembers), after)
 
 proc getListTimeline*(id: string; after=""): Future[Timeline] {.async.} =