Fix renderReplies, take 2
This commit is contained in:
		
							parent
							
								
									3dec3fba38
								
							
						
					
					
						commit
						dc3c37b854
					
				| 
						 | 
					@ -19,6 +19,8 @@ proc createStatusRouter*(cfg: Config) =
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if @"scroll".len > 0:
 | 
					      if @"scroll".len > 0:
 | 
				
			||||||
        let replies = await getReplies(@"name", @"id", @"max_position", getAgent())
 | 
					        let replies = await getReplies(@"name", @"id", @"max_position", getAgent())
 | 
				
			||||||
 | 
					        if replies == nil:
 | 
				
			||||||
 | 
					          resp Http404, ""
 | 
				
			||||||
        resp $renderReplies(replies, prefs, getPath())
 | 
					        resp $renderReplies(replies, prefs, getPath())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      let conversation = await getTweet(@"name", @"id", @"max_position", getAgent())
 | 
					      let conversation = await getTweet(@"name", @"id", @"max_position", getAgent())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,6 @@ proc renderReplyThread(thread: Chain; prefs: Prefs; path: string): VNode =
 | 
				
			||||||
 | 
					
 | 
				
			||||||
proc renderReplies*(replies: Result[Chain]; prefs: Prefs; path: string): VNode =
 | 
					proc renderReplies*(replies: Result[Chain]; prefs: Prefs; path: string): VNode =
 | 
				
			||||||
  buildHtml(tdiv(class="replies", id="r")):
 | 
					  buildHtml(tdiv(class="replies", id="r")):
 | 
				
			||||||
    if replies == nil: return
 | 
					 | 
				
			||||||
    for thread in replies.content:
 | 
					    for thread in replies.content:
 | 
				
			||||||
      if thread == nil: continue
 | 
					      if thread == nil: continue
 | 
				
			||||||
      renderReplyThread(thread, prefs, path)
 | 
					      renderReplyThread(thread, prefs, path)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue