Fixed infinite loading when there's no comments #216
1 changed files with 4 additions and 1 deletions
|
@ -228,7 +228,10 @@ else {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noCache && commentCache[page]) addComments(commentCache[page])
|
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) {
|
function addComments(res) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue