Resolve a race condition?

This commit is contained in:
Zixaphir 2015-01-12 22:57:12 -07:00
parent bc7962b906
commit aa6b181563
4 changed files with 24 additions and 0 deletions

View File

@ -18662,6 +18662,13 @@
return;
}
}
if (Navigate.isNavigating) {
return e != null ? e.preventDefault() : void 0;
}
Navigate.isNavigating = true;
setTimeout((function() {
return delete Navigate.isNavigating;
}), 100);
if (this.pathname === Navigate.path) {
if (g.VIEW === 'thread') {
ThreadUpdater.update();

View File

@ -18696,6 +18696,13 @@
return;
}
}
if (Navigate.isNavigating) {
return e != null ? e.preventDefault() : void 0;
}
Navigate.isNavigating = true;
setTimeout((function() {
return delete Navigate.isNavigating;
}), 100);
if (this.pathname === Navigate.path) {
if (g.VIEW === 'thread') {
ThreadUpdater.update();

View File

@ -101,12 +101,15 @@ Index =
@selectMode = $ '#index-mode', @navLinks
@selectSort = $ '#index-sort', @navLinks
@selectSize = $ '#index-size', @navLinks
$.on @searchInput, 'input', @onSearchInput
$.on $('#index-search-clear', @navLinks), 'click', @clearSearch
$.on $('#hidden-toggle a', @navLinks), 'click', @cb.toggleHiddenThreads
for select in [@selectMode, @selectSort, @selectSize]
select.value = Conf[select.name]
$.on select, 'change', $.cb.value
$.on @selectMode, 'change', @cb.mode
$.on @selectSort, 'change', @cb.sort
$.on @selectSize, 'change', @cb.size

View File

@ -206,6 +206,13 @@ Navigate =
Navigate.setMode @ unless e.button is 2 # Right Click
return
return e?.preventDefault() if Navigate.isNavigating
Navigate.isNavigating = true
# XXX Prevent accidental double-navigates race condition
setTimeout (-> delete Navigate.isNavigating), 100
if @pathname is Navigate.path
if g.VIEW is 'thread'
ThreadUpdater.update()