fix(electron): auto updater callback payload error

pull/2973/head
charlie 2021-10-14 10:28:34 +08:00 committed by Tienson Qin
parent 13beeb4c93
commit a25bff4d83
3 changed files with 10 additions and 6 deletions

View File

@ -111,10 +111,11 @@
(emit "completed" nil))))))))
(defn- new-version-downloaded-cb
[_ & args]
(.info logger "[update-downloaded]" args)
[_ notes name date url]
(.info logger "[update-downloaded]" name notes date url)
(when-let [web-contents (and @*win (. ^js @*win -webContents))]
(.send web-contents "auto-updater-downloaded" (bean/->js args))))
(.send web-contents "auto-updater-downloaded"
(bean/->js {:notes notes :name name :date date :url url}))))
(defn init-auto-updater
[repo]

View File

@ -142,7 +142,7 @@
_ (rum/use-effect!
(fn []
(when-let [channel (and (util/electron?) "auto-updater-downloaded")]
(let [callback (fn [_ & args]
(let [callback (fn [_ args]
(js/console.debug "[new-version downloaded] args:" args)
(let [args (bean/->clj args)]
(set-downloaded args)

View File

@ -44,7 +44,9 @@
> p {
margin: 0;
padding: 0 0 6px 0;
display: flex;
align-items: center;
font-size: 14px;
}
a {
@ -53,8 +55,9 @@
a.restart {
position: relative;
top: 3px;
cursor: pointer !important;
display: flex;
align-items: center;
svg {
color: currentColor !important;