fix(electron): avoid notifying destroyed window

pull/3531/head
Andelf 2022-01-01 23:00:35 +08:00 committed by Tienson Qin
parent 414eaf9691
commit a393d9f933
1 changed files with 4 additions and 3 deletions

View File

@ -16,9 +16,10 @@
(defonce file-watcher-chan "file-watcher")
(defn send-file-watcher! [^js win type payload]
(.. win -webContents
(send file-watcher-chan
(bean/->js {:type type :payload payload}))))
(when-not (.isDestroyed win)
(.. win -webContents
(send file-watcher-chan
(bean/->js {:type type :payload payload})))))
(defn- publish-file-event!
[win dir path event]