Return correct match when filtering out event

This commit is contained in:
Daniel Compton 2018-01-26 19:32:05 +13:00
parent 022a070fb8
commit a43ff6464b
2 changed files with 4 additions and 0 deletions

View File

@ -188,6 +188,9 @@
match (cond
(nil? current-id) (last (:matches epochs))
(< current-id (first match-ids)) (first (:matches epochs))
;; This case seems impossible, but can happen if the user filters out
;; an event that they are 'on'.
(> current-id (last match-ids)) (last (:matches epochs))
:else (get (:matches-by-id epochs) current-id))]
match)))

View File

@ -12,6 +12,7 @@
[rc/label :label (str "Number of epochs " (prn-str @(rf/subscribe [:epochs/number-of-matches])))]
[rc/label :label (str "Beginning trace " (prn-str @(rf/subscribe [:epochs/beginning-trace-id])))]
[rc/label :label (str "Ending " (prn-str @(rf/subscribe [:epochs/ending-trace-id])))]
[rc/label :label (str "Current epoch ID " (prn-str @(rf/subscribe [:epochs/current-epoch-id])))]
[rc/label :label "Epochs"]
(let [current-match @(rf/subscribe [:epochs/current-match])]