                      (set-results!
                        (seq (mapcat (fn [e] (e v (config :thread-id))) engines)))
                      (highlight-first!)
+                     (recur)))))
+           (go (loop []
+                 (let [[v ch] (alts! [throttled-thread-text-chan thread-text-kill-chan])]
+                   (when (= ch throttled-thread-text-chan)
+                     (dispatch! :new-message-text v)
                      (recur)))))))
 
        :component-will-update
        (fn [c [_ {new-config :config}]]
-         (reset! thread-id (new-config :thread-id)))
+         (reset! thread-id (new-config :thread-id))
+         (swap! state assoc :text @thread-text))
 
        :component-will-unmount
        (fn []
-         (put! kill-chan (js/Date.)))
+         (put! kill-chan (js/Date.))
+         (put! thread-text-kill-chan (js/Date.)))
 
        :reagent-render
        (fn [{:keys [config textarea-view results-view]}]

        kill-chan (chan)
        throttled-autocomplete-chan (debounce autocomplete-chan 100)

        thread-id (r/atom (config :thread-id))
        thread-text (subscribe [:thread-new-message] [thread-id])

        state (r/atom {:text thread-text
                       :force-close? false
                       :highlighted-result-index 0
                       :results nil})

                                     (resize-textbox (.. e -target)))})
                     :on-key-down (on-key-down
                                    {:on-submit (fn [e]
                                                  (send-message! config text)
                                                  (set-text! ""))})}])})))

(defn autocomplete-results-view [{:keys [results highlighted-result-index on-click]}]
