Skip to content

Commit 8adfbe1

Browse files
committed
Turn download alert into clickable link
1 parent 19f897f commit 8adfbe1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/kii/bindings/electron_renderer.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
(defonce electron (js/require "electron"))
44
(def ipc (.-ipcRenderer electron))
5+
(def shell (.-shell electron))
56

67
(defn send-to-main [event]
78
(.send ipc (:name event) (:arg event)))

src/kii/ui/conf/actions/handlers.cljs

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@
5959
:download-complete
6060
(fn [{:keys [db]} [_ {:keys [status path error]}]]
6161
(case status
62-
"success" {:dispatch [:alert/add {:type :success :msg (str "Completed download: " path)}]}
62+
"success" {:dispatch [:alert/add {:type :success :msg [:span "Completed download: "
63+
[:span {:style {:cursor "pointer"
64+
:text-decoration "underline"}
65+
:on-click #(.showItemInFolder electron/shell path)}
66+
path]]}]}
6367
"error" (do
6468
(logf :error "Failed to download file %s" error)
6569
{:dispatch [:alert/add {:type :error :msg "Failed to download"}]}))

0 commit comments

Comments
 (0)