From c65a0668c7cf36e64ed0e0f58fcaeb979fab49da Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 23 Jan 2016 13:45:06 -0800 Subject: [PATCH] In case of incomplete pageload, index refresh should hard refresh. #509 --- src/General/Index.coffee | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 193046406..0264c8330 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -90,7 +90,7 @@ Index = $('.cataloglink a', @pagelist).href = CatalogLinks.catalog() $.on @pagelist, 'click', @cb.pageNav - @update() + @update true $.onExists doc, 'title + *', -> d.title = d.title.replace /\ -\ Page\ \d+/, '' @@ -417,7 +417,7 @@ Index = else "#{hiddenCount} hidden threads" - update: -> + update: (firstTime) -> Index.req?.abort() Index.notice?.close() @@ -433,6 +433,11 @@ Index = Index.notice = new Notice 'info', 'Refreshing index...' ), 3 * $.SECOND - (Date.now() - now) + # Hard refresh in case of incomplete page load. + if not firstTime and d.readyState isnt 'loading' and not $('.board + *') + location.reload() + return + Index.req = $.ajax "//a.4cdn.org/#{g.BOARD}/catalog.json", onloadend: Index.load ,