mirror of
https://codeberg.org/tacerus/teddit.git
synced 2024-11-29 02:59:26 +01:00
fix an issue when user doesnt have any posts/comments
This commit is contained in:
parent
5757ba1b57
commit
3b5779f371
@ -22,8 +22,14 @@ module.exports = function() {
|
|||||||
user_front = true
|
user_front = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(json.overview.data.children) {
|
||||||
|
if(json.overview.data.children[posts_limit - 1]) {
|
||||||
after = json.overview.data.children[posts_limit - 1].data.name
|
after = json.overview.data.children[posts_limit - 1].data.name
|
||||||
|
}
|
||||||
|
if(json.overview.data.children[0]) {
|
||||||
before = json.overview.data.children[0].data.name
|
before = json.overview.data.children[0].data.name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(var i = 0; i < posts_limit; i++) {
|
for(var i = 0; i < posts_limit; i++) {
|
||||||
let post = json.overview.data.children[i].data
|
let post = json.overview.data.children[i].data
|
||||||
|
@ -59,6 +59,8 @@ html
|
|||||||
li(class=past === 'all' ? 'active' : '')
|
li(class=past === 'all' ? 'active' : '')
|
||||||
a(href="?sort=" + sortby + "&t=all") all time
|
a(href="?sort=" + sortby + "&t=all") all time
|
||||||
.entries
|
.entries
|
||||||
|
if !data.posts || data.posts.length <= 0
|
||||||
|
h3 no posts/comments
|
||||||
each post in data.posts
|
each post in data.posts
|
||||||
if post.type === 't3'
|
if post.type === 't3'
|
||||||
.entry.t3
|
.entry.t3
|
||||||
|
Loading…
Reference in New Issue
Block a user