ソースを参照

fix: close history panel after select a version

Liu Hancheng 2 年 前
コミット
b6294853a6
1 ファイル変更10 行追加9 行削除
  1. 10 9
      src/main/frontend/handler/shell.cljs

+ 10 - 9
src/main/frontend/handler/shell.cljs

@@ -1,14 +1,14 @@
 (ns frontend.handler.shell
   "Git related handler fns"
-  (:require [electron.ipc :as ipc]
-            [clojure.string :as string]
-            [logseq.graph-parser.util :as gp-util]
-            [frontend.handler.notification :as notification]
-            [promesa.core :as p]
+  (:require [clojure.string :as string]
+            [electron.ipc :as ipc]
+            [frontend.config :as config]
             [frontend.db :as db]
+            [frontend.handler.notification :as notification]
             [frontend.state :as state]
-            [frontend.config :as config]
-            [frontend.util :as util]))
+            [frontend.util :as util]
+            [logseq.graph-parser.util :as gp-util]
+            [promesa.core :as p]))
 
 (defn run-git-command!
   [command]
@@ -29,7 +29,7 @@
   (p/let [result (f command args)]
     (notification/show!
      (if (string/blank? result)
-       [:p [:code.mr-1 (str command " " args) ]
+       [:p [:code.mr-1 (str command " " args)]
         "was executed successfully!"]
        result)
      :success
@@ -86,7 +86,8 @@
                                     [:hr]
                                     [:div.mb-2
                                      [:a.font-medium.mr-1.inline
-                                      {:on-click (fn [] (get-versioned-file-content hash path))}
+                                      {:on-click (fn [] ((notification/clear-all!)
+                                                         (get-versioned-file-content hash path)))}
                                       hash]
                                      title]
                                     [:div.opacity-50 time]]))] :success false))))))