Optimization: don't reset grub/recipe edit state if unchanged
This commit is contained in:
parent
86bfdf80e4
commit
76074e5b5c
2 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@
|
|||
[:editing :waiting] (let [grub (om/get-props owner)]
|
||||
(om/transact! grub #(assoc % :text (om/get-state owner :grub-text))))
|
||||
nil)
|
||||
(om/set-state! owner :edit-state next)))
|
||||
(when-not (= current next) (om/set-state! owner :edit-state next))))
|
||||
|
||||
(defn view [{:keys [id text completed] :as grub} owner {:keys [remove-ch]}]
|
||||
(reify
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
grubs (om/get-state owner :grubs)]
|
||||
(om/transact! recipe #(assoc % :name name :grubs grubs)))
|
||||
nil)
|
||||
(om/set-state! owner :edit-state next)))
|
||||
(when-not (= current next) (om/set-state! owner :edit-state next))))
|
||||
|
||||
(defn num-newlines [str]
|
||||
(count (re-seq #"\n" str)))
|
||||
|
|
Loading…
Reference in a new issue