Przeglądaj źródła

fix: cannot save autostart of http server config

autostart checkbox also wasn't checked when set previously
Fixes https://github.com/logseq/db-test/issues/261.
https://github.com/logseq/logseq/issues/10337 looks like its already
fixed
Gabriel Horner 5 miesięcy temu
rodzic
commit
25ad92ae09
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/main/frontend/components/server.cljs

+ 2 - 2
src/main/frontend/components/server.cljs

@@ -74,7 +74,7 @@
                          (not= (util/safe-parse-int (or port 0))
                                (util/safe-parse-int (or (:port server-state) 0))))
         changed?     (or hp-changed? (->> [autostart (:autostart server-state)]
-                                          (mapv #(cond-> % (nil? %) not))
+                                          (mapv #(cond-> % (nil? %) boolean))
                                           (apply not=)))]
 
     [:div.cp__server-configs-panel.pt-5
@@ -104,7 +104,7 @@
        (ui/checkbox
         {:on-change #(let [checked (.-checked (.-target %))]
                        (swap! *configs assoc :autostart checked))
-         :value     (not (false? autostart))})
+         :checked   (not (false? autostart))})
 
        [:strong.select-none "Auto start server with the app launched"]]]