Skip to content

Commit

Permalink
v0.6.13: window-id in sessionStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasn committed Oct 12, 2017
1 parent 448b128 commit 7de2d18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 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.13] - 2017-10-13
### Changed
- window-id in sessionStorage

## [0.6.12] - 2017-10-13
### Changed
- window-id in cookie
Expand Down
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject matthiasn/systems-toolbox-electron "0.6.12"
(defproject matthiasn/systems-toolbox-electron "0.6.13"
: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
5 changes: 2 additions & 3 deletions src/matthiasn/systems_toolbox_electron/ipc_renderer.cljs
@@ -1,7 +1,6 @@
(ns matthiasn.systems-toolbox-electron.ipc-renderer
(:require [electron :refer [ipcRenderer]]
[taoensso.timbre :as timbre :refer-macros [info debug error]]
[goog.net.cookies]
[cljs.reader :refer [read-string]]))

(defn state-fn [put-fn]
Expand All @@ -17,14 +16,14 @@
(catch js/Object e (error e "when parsing" m))))
id-handler (fn [ev window-id]
(info "IPC: window-id" window-id)
(.set goog.net.cookies "window-id" window-id))]
(aset js/sessionStorage "windowId" window-id))]
(.on ipcRenderer "relay" relay)
(.on ipcRenderer "window-id" id-handler)
(info "Starting IPC Component")
{:state state}))

(defn relay-msg [{:keys [current-state msg-type msg-meta msg-payload]}]
(let [window-id (.get goog.net.cookies "window-id")
(let [window-id (aget js/sessionStorage "windowId")
msg-meta (assoc-in msg-meta [:window-id] window-id)
serializable [msg-type {:msg-payload msg-payload
:msg-meta msg-meta}]]
Expand Down

0 comments on commit 7de2d18

Please sign in to comment.