 (defn handle-new-messages
   "Analyzes new messages and appends them to the :messages list in a state."
   [{:keys [cmp-state msg-payload]}]
-  (let [{:keys [total-messages-count message-limit first-message-ts]} @cmp-state
+  (let [{:keys [view total-messages-count message-limit first-message-ts]} @cmp-state
         assign-message-idx (fn [total-count msgs]
                              (map-indexed #(assoc %2 :idx (+ %1 1 total-count)) msgs))
         messages (->> msg-payload

  (local-storage (atom {:message-limit 500
                        :message-filters #{}}) :settings))

(defonce initial-state
  {
   ;; List of messages captured. Oldest first. When messages are filtered, they are
   ;; removed/not stored here.

                      correlate-sender-with-receiver
                      (assign-message-idx total-messages-count))
        messages-filtered (apply-message-filters cmp-state messages)]
   (when (= :probe-error view) (show-component {:cmp-state cmp-state :msg-payload :cmp/messages}))
   (when (zero? first-message-ts) (swap! cmp-state assoc :first-message-ts (-> messages first :ts)))
   (swap! cmp-state update-in [:total-messages-count] (partial + (count messages)))
   (swap! cmp-state update-in [:messages] (fn [msgs]
