j-ramos 1 anno fa
parent
commit
1661fe6271
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      src/main/frontend/handler/editor.cljs

+ 3 - 3
src/main/frontend/handler/editor.cljs

@@ -2342,12 +2342,12 @@
 
 
 (defn toggle-list-checkbox
 (defn toggle-list-checkbox
   [{:block/keys [content] :as block} old-item-content new-item-content]
   [{:block/keys [content] :as block} old-item-content new-item-content]
-  (let [replace-first #(string/replace-first content % new-item-content)
-        new-content (replace-first old-item-content)]
+  (let [update-content #(string/replace-first content % new-item-content)
+        new-content (update-content old-item-content)]
     (save-block-if-changed!
     (save-block-if-changed!
       block
       block
       (if (= new-content content)
       (if (= new-content content)
-        (replace-first (string/replace-first old-item-content "[X]" "[x]"))
+        (update-content (string/replace-first old-item-content "[X]" "[x]"))
         new-content))))
         new-content))))
 
 
 (defn- dwim-in-list
 (defn- dwim-in-list