aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2015-01-11 11:08:43 -0600
committerDavid Barksdale <amatus@amatus.name>2015-01-11 11:08:43 -0600
commitb960d30cc23fd737e95446411681a77b9dcc6344 (patch)
tree7ddcb185e201baebaa29adc8288bec2c30930ff6
parent486dc0d4e4fb787c45fe18a07acb98a7df8e10c7 (diff)
Fix stale state when starting a new search
-rw-r--r--src/hl/index.cljs.hl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hl/index.cljs.hl b/src/hl/index.cljs.hl
index c0b0d34..2004b72 100644
--- a/src/hl/index.cljs.hl
+++ b/src/hl/index.cljs.hl
@@ -339,6 +339,12 @@
download-state (cell :inactive)
download-progress (cell 0)
download-object (cell nil)]
+ (add-watch result nil
+ (fn [_ _ _ new-state]
+ (when (nil? new-state)
+ (reset! download-state :inactive)
+ (reset! download-progress 0)
+ (reset! download-object nil))))
(tr
(td
(div :class "ui compact menu"