Skip to content

Commit

Permalink
fix render
Browse files Browse the repository at this point in the history
  • Loading branch information
leohhhn committed Mar 15, 2024
1 parent ccba39d commit ec434eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/r/memeland/memeland.gno
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ func GetPostsInRange(startTimestamp, endTimestamp int64, page, pageSize int, sor
}

func Render(path string) string {
numOfMemes := int(m.MemeCounter)
if numOfMemes == 0 {
return "no memes yet :c"
}

// Default render is get Posts since year 2000 to now
postsJson := m.GetPostsInRange(952733931, time.Now().Unix(), 1, 100, "DATE_CREATED")
postsJson := m.GetPostsInRange(952733931, time.Now().Unix(), 1, numOfMemes, "DATE_CREATED")
if postsJson == "[]" {
return "no memes yet :c"
}
return postsJson
}

0 comments on commit ec434eb

Please sign in to comment.