       (if (= :remember (get-in app-state [:ui-state :section])) ; Just in case we allow editing from elsewhere...
         (dispatch [:memories-load]))
       (if thread
-        (dispatch [:thread-load (:root-id (first thread))]))
+        (dispatch [:thread-load (:id (first thread))]))
       (-> app-state
           (assoc-in [:ui-state :is-busy?] false)
           (assoc-in [:note :edit-memory] nil)

  :memory-forget
  (fn [app-state [_ root-id]]
    (let [url (str "/api/memory/" root-id "/thought")]
      (.log js/console url)
      (DELETE url {:headers       {:authorization (str "Token " (get-in app-state [:credentials :token]))}
                   :handler       #(dispatch [:memory-forget-success %])
                   :error-handler #(dispatch [:memory-forget-error %])}))

(register-handler
  :memory-forget-success
  (fn [app-state [_ msg]]
    (let [thread     (get-in app-state [:note :thread])
          in-thread? (and thread
                          (get-in app-state [:ui-state :show-thread?]))]
      (dispatch [:state-message (str "Thought forgotten") "alert-success"])
      (if (= :remember (get-in app-state [:ui-state :section])) ; Just in case we allow editing from elsewhere...
        (dispatch [:memories-load]))
      (if in-thread?
        (dispatch [:thread-load (:id (first thread))]))
      (-> app-state
          (assoc-in [:ui-state :is-busy?] false)
          (assoc-in [:note :edit-memory] nil)
          (assoc-in [:note :edit-note] "")
          (assoc-in [:note :focus] nil)
          (assoc :search-state nil)
          )))
  )

(register-handler
  :memory-forget-error
