mirror of https://github.com/logseq/logseq
enhance: don't show diff if there's only blank changes
parent
0b55d119aa
commit
b86a801514
|
@ -247,7 +247,7 @@
|
||||||
[:span.cp__diff-file-header-content.pl-1.font-medium {:style {:word-break "break-word"}}
|
[:span.cp__diff-file-header-content.pl-1.font-medium {:style {:word-break "break-word"}}
|
||||||
(str "File " path " has been modified on the disk.")]]
|
(str "File " path " has been modified on the disk.")]]
|
||||||
[:div.p-4
|
[:div.p-4
|
||||||
(when (not= disk-content db-content)
|
(when (not= (string/trim disk-content) (string/trim db-content))
|
||||||
(ui/foldable
|
(ui/foldable
|
||||||
[:span.text-sm.font-medium.ml-1 "Check diff"]
|
[:span.text-sm.font-medium.ml-1 "Check diff"]
|
||||||
(fn []
|
(fn []
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
[datascript.core :as d]
|
[datascript.core :as d]
|
||||||
["semver" :as semver]
|
["semver" :as semver]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[rum.core :as rum]))
|
[rum.core :as rum]
|
||||||
|
[clojure.string :as string]))
|
||||||
|
|
||||||
;; TODO: should we move all events here?
|
;; TODO: should we move all events here?
|
||||||
|
|
||||||
|
@ -156,7 +157,8 @@
|
||||||
(defmethod handle :file/not-matched-from-disk [[_ path disk-content db-content]]
|
(defmethod handle :file/not-matched-from-disk [[_ path disk-content db-content]]
|
||||||
(state/clear-edit!)
|
(state/clear-edit!)
|
||||||
(when-let [repo (state/get-current-repo)]
|
(when-let [repo (state/get-current-repo)]
|
||||||
(state/set-modal! #(diff/local-file repo path disk-content db-content))))
|
(when (not= (string/trim disk-content) (string/trim db-content))
|
||||||
|
(state/set-modal! #(diff/local-file repo path disk-content db-content)))))
|
||||||
|
|
||||||
(defmethod handle :modal/display-file-version [[_ path content hash]]
|
(defmethod handle :modal/display-file-version [[_ path content hash]]
|
||||||
(state/set-modal! #(git-component/file-specific-version path hash content)))
|
(state/set-modal! #(git-component/file-specific-version path hash content)))
|
||||||
|
|
Loading…
Reference in New Issue