Fix rare threadlist race condition properly.

This commit is contained in:
Dominik Picheta 2018-05-18 20:53:07 +01:00
commit 770b5cddab

View file

@ -163,8 +163,10 @@ when defined(js):
if state.status != Http200:
return renderError("Couldn't retrieve threads.")
if state.list.isNone and (not state.loading):
ajaxGet(makeUri("threads.json"), @[], onThreadList)
if state.list.isNone:
if not state.loading:
state.loading = true
ajaxGet(makeUri("threads.json"), @[], onThreadList)
return buildHtml(tdiv(class="loading loading-lg"))