|
145 | 145 | (rf/reg-event-fx
|
146 | 146 | ::add-listeners
|
147 | 147 | (fn [_ _]
|
148 |
| - {:fx [[::effects/add-listener [js/document "keydown" |
149 |
| - [::event.events/keyboard] event.impl.keyboard/->clj]] |
150 |
| - [::effects/add-listener [js/document "keyup" |
151 |
| - [::event.events/keyboard] event.impl.keyboard/->clj]] |
152 |
| - [::effects/add-listener [js/document "fullscreenchange" |
153 |
| - [::window.events/update-fullscreen]]] |
154 |
| - [::effects/add-listener [js/window "load" [::window.events/update-focused]]] |
155 |
| - [::effects/add-listener [js/window "focus" [::window.events/update-focused]]] |
156 |
| - [::effects/add-listener [js/window "blur" [::window.events/update-focused]]]]})) |
| 148 | + {:fx (->> [[js/document "keydown" [::event.events/keyboard] event.impl.keyboard/->clj] |
| 149 | + [js/document "keyup" [::event.events/keyboard] event.impl.keyboard/->clj] |
| 150 | + [js/document "fullscreenchange" [::window.events/update-fullscreen]] |
| 151 | + [js/window "load" [::window.events/update-focused]] |
| 152 | + [js/window "focus" [::window.events/update-focused]] |
| 153 | + [js/window "blur" [::window.events/update-focused]]] |
| 154 | + (mapv #(vector ::effects/add-listener %)))})) |
157 | 155 |
|
158 | 156 | (rf/reg-event-fx
|
159 | 157 | ::register-listeners
|
160 | 158 | (fn [_ _]
|
161 | 159 | (if utils.system/electron?
|
162 |
| - {:fx [[::effects/ipc-on ["window-maximized" [::window.events/set-maximized true]]] |
163 |
| - [::effects/ipc-on ["window-unmaximized" [::window.events/set-maximized false]]] |
164 |
| - [::effects/ipc-on ["window-focused" [::window.events/set-focused true]]] |
165 |
| - [::effects/ipc-on ["window-blurred" [::window.events/set-focused false]]] |
166 |
| - [::effects/ipc-on ["window-entered-fullscreen" [::window.events/set-fullscreen true]]] |
167 |
| - [::effects/ipc-on ["window-leaved-fullscreen" [::window.events/set-fullscreen false]]] |
168 |
| - [::effects/ipc-on ["window-minimized" [::window.events/set-minimized true]]] |
169 |
| - [::effects/ipc-on ["window-loaded" [::add-listeners]]]]} |
| 160 | + {:fx (->> [["window-maximized" [::window.events/set-maximized true]] |
| 161 | + ["window-unmaximized" [::window.events/set-maximized false]] |
| 162 | + ["window-focused" [::window.events/set-focused true]] |
| 163 | + ["window-blurred" [::window.events/set-focused false]] |
| 164 | + ["window-entered-fullscreen" [::window.events/set-fullscreen true]] |
| 165 | + ["window-leaved-fullscreen" [::window.events/set-fullscreen false]] |
| 166 | + ["window-minimized" [::window.events/set-minimized true]] |
| 167 | + ["window-loaded" [::add-listeners]]] |
| 168 | + (mapv #(vector ::effects/ipc-on %)))} |
170 | 169 | {:dispatch [::add-listeners]})))
|
0 commit comments