 
         at-bottom? (atom true)
         first-scroll? (atom true)
+
+        old-last-msg (atom nil)
 
         check-at-bottom
         (fn []


        last-open-at (subscribe [:thread-last-open-at thread-id])

        unseen? (fn [message] (> (:created-at message)
                                        @last-open-at))

        kill-chan (chan)
        embed-update-chan (chan)

       :component-will-unmount
       (fn [] (put! kill-chan (js/Date.)))

       :component-did-update
       (fn [c _]
         (let [last-msg (last @messages)]
           (when (and (not= @old-last-msg (:id last-msg))
                      (= (:user-id last-msg) @(subscribe [:user-id])))
             (reset! at-bottom? true))
           (reset! old-last-msg (:id last-msg)))
         (scroll-to-bottom! c))

       :reagent-render
       (fn [thread-id]
