fix: separate dict to solve cyclic dependency

This commit is contained in:
Weihua Lu
2021-05-14 03:19:22 +08:00
parent 116d7574b1
commit 5e081ed91c
7 changed files with 60 additions and 42 deletions

View File

@@ -1,6 +1,7 @@
(ns frontend.components.commit
(:require [rum.core :as rum]
[frontend.util :as util :refer-macros [profile]]
[clojure.string :as string]
[frontend.handler.repo :as repo-handler]
[frontend.state :as state]
[frontend.mixins :as mixins]
@@ -53,3 +54,16 @@
{:type "button"
:on-click close-fn}
"Cancel"]]]]))
(defn show-commit-modal! [e]
(when (and
(string/starts-with? (state/get-current-repo) "https://")
(not (util/input? (gobj/get e "target")))
(not (gobj/get e "shiftKey"))
(not (gobj/get e "ctrlKey"))
(not (gobj/get e "altKey"))
(not (gobj/get e "metaKey")))
(when-let [repo-url (state/get-current-repo)]
(when-not (state/get-edit-input-id)
(util/stop e)
(state/set-modal! commit-and-push!)))))