Fixed infinite loading when there's no comments (#216)
This commit is contained in:
parent
7aef474a06
commit
b2320d3c9c
1 changed files with 4 additions and 1 deletions
|
@ -228,7 +228,10 @@ else {
|
|||
}
|
||||
|
||||
if (!noCache && commentCache[page]) addComments(commentCache[page])
|
||||
fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID}?count=${compact && !auto ? 20 : 10}&page=${page}${history ? "&type=commentHistory" : ""}&${mode}`).then(res => res.json()).then(addComments)
|
||||
fetch(`../api${!history ? window.location.pathname : "/comments/" + lvl.playerID}?count=${compact && !auto ? 20 : 10}&page=${page}${history ? "&type=commentHistory" : ""}&${mode}`).then((res) => {
|
||||
if (res.status === 204) return [];
|
||||
return res.json();
|
||||
}).then(addComments)
|
||||
|
||||
function addComments(res) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue