Skip to content

Commit

Permalink
v0.6.11: set window-id with delay
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Oct 12, 2017
1 parent 6d90402 commit 1c072cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).


## [0.6.11] - 2017-10-13
### Changed
- set window-id with delay

## [0.6.10] - 2017-10-08
### Changed
- hide and show windows
Expand Down
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject matthiasn/systems-toolbox-electron "0.6.10"
(defproject matthiasn/systems-toolbox-electron "0.6.11"
:description "Building blocks for ClojureScript systems on top of Electron"
:url "https://github.com/matthiasn/systems-toolbox-electron"
:license {:name "Eclipse Public License"
Expand Down
7 changes: 5 additions & 2 deletions src/matthiasn/systems_toolbox_electron/window_manager.cljs
Expand Up @@ -24,7 +24,7 @@
url (str "file://" (:app-path current-state) "/" url)
new-spare (when cached (load-new url))
new-spare-wc (when cached (.-webContents new-spare))
new-spare-init #(let [js "window.location = '/#/empty'"
new-spare-init #(let [js "window.location = ''"
s (serialize :exec/js {:js js} {})]
(.send new-spare-wc "relay" s))
window-id (or window-id (stc/make-uuid))
Expand All @@ -50,10 +50,13 @@
(debug "Closed" window-id)
(swap! cmp-state assoc-in [:active] nil)
(swap! cmp-state update-in [:windows] dissoc window-id))
send-id #(.send (.-webContents window) "window-id" (str window-id))
ready (fn [_]
(debug "ready" window-id)
(show)
(.send (.-webContents window) "window-id" (str window-id)))]
(js/setTimeout send-id 1000)
(js/setTimeout send-id 2000)
(js/setTimeout send-id 5000))]
(info "Opening new window" url window-id)
(.on window "focus" #(js/setTimeout focus 10))
(when cached (.on new-spare-wc "did-finish-load" new-spare-init))
Expand Down

0 comments on commit 1c072cc

Please sign in to comment.