Skip to content

Commit

Permalink
fix(ui): warn about illegal git commit interval
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf authored and tiensonqin committed Apr 15, 2022
1 parent 1150547 commit dbd8e1e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/main/frontend/components/settings.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 191,18 @@
[:input#home-default-page.form-input.is-small.transition.duration-150.ease-in-out
{:default-value secs
:on-blur (fn [event]
(when-let [value (-> (util/evalue event)
util/safe-parse-int)]
(when (< 0 value (inc 600))
(state/set-state! [:electron/user-cfgs :git/auto-commit-seconds] value)
(ipc/ipc "userAppCfgs" :git/auto-commit-seconds value))))}]]]]))
(let [value (-> (util/evalue event)
util/safe-parse-int)]
(if (and (number? value)
(< 0 value (inc 600)))
(do
(state/set-state! [:electron/user-cfgs :git/auto-commit-seconds] value)
(ipc/ipc "userAppCfgs" :git/auto-commit-seconds value))
(when-let [elem (gobj/get event "target")]
(notification/show!
[:div "Invalid value! Must be a number between 1 and 600."]
:warning true)
(gobj/set elem "value" secs)))))}]]]]))

(rum/defc app-auto-update-row < rum/reactive [t]
(let [enabled? (state/sub [:electron/user-cfgs :auto-update])
Expand Down

0 comments on commit dbd8e1e

Please sign in to comment.