Skip to content

Commit 027afa1

Browse files
committed
update main.cljs indentation
1 parent 7f87a1d commit 027afa1

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

src/electron/main.cljs

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,52 @@
4747
(defn open-external!
4848
[url]
4949
(let [url-parsed (js/URL. url)]
50-
(when (and (= (.-protocol url-parsed) "https:") (allowed-url? url-parsed))
50+
(when (and (= (.-protocol url-parsed) "https:")
51+
(allowed-url? url-parsed))
5152
(.openExternal shell url-parsed.href))))
5253

5354
(defn to-main-api
5455
[args]
5556
(case (.-action args)
56-
"windowMinimize" (.minimize ^js @main-window)
57-
"windowToggleMaximized" (if (.isMaximized ^js @main-window) (.unmaximize ^js @main-window) (.maximize ^js @main-window))
58-
"windowToggleFullscreen" (.setFullScreen ^js @main-window (not (.isFullScreen ^js @main-window)))
59-
"setThemeMode" (set! (.. nativeTheme -themeSource) (.-data args))
60-
"openRemoteUrl" (open-external! (.-data args))
57+
"windowMinimize"
58+
(.minimize ^js @main-window)
59+
60+
"windowToggleMaximized"
61+
(if (.isMaximized ^js @main-window)
62+
(.unmaximize ^js @main-window)
63+
(.maximize ^js @main-window))
64+
65+
"windowToggleFullscreen"
66+
(.setFullScreen ^js @main-window (not (.isFullScreen ^js @main-window)))
67+
68+
"setThemeMode"
69+
(set! (.. nativeTheme -themeSource) (.-data args))
70+
71+
"openRemoteUrl"
72+
(open-external! (.-data args))
73+
6174
;; https://www.electronjs.org/docs/api/clipboard#clipboardwritedata-type
62-
"writeToClipboard" (.write clipboard (.-data args))
63-
"openDirectory" (.showItemInFolder shell (.-data args))
64-
"openDocument" (p/let [documents (file/open! @main-window (.-data args))] (doseq [document documents] (send-to-renderer! "fileLoaded" document)))
65-
"saveDocument" (p/let [document (file/save! @main-window (.-data args))] (send-to-renderer! "fileSaved" document))
66-
"saveDocumentAs" (p/let [document (file/save-as! @main-window (.-data args))] (send-to-renderer! "fileSaved" document))
67-
"export" (file/export! @main-window (.-data args))))
75+
"writeToClipboard"
76+
(.write clipboard (.-data args))
77+
78+
"openDirectory"
79+
(.showItemInFolder shell (.-data args))
80+
81+
"openDocument"
82+
(p/let [documents (file/open! @main-window (.-data args))]
83+
(doseq [document documents]
84+
(send-to-renderer! "fileLoaded" document)))
85+
86+
"saveDocument"
87+
(p/let [document (file/save! @main-window (.-data args))]
88+
(send-to-renderer! "fileSaved" document))
89+
90+
"saveDocumentAs"
91+
(p/let [document (file/save-as! @main-window (.-data args))]
92+
(send-to-renderer! "fileSaved" document))
93+
94+
"export"
95+
(file/export! @main-window (.-data args))))
6896

6997
(defn register-window-events!
7098
[]

0 commit comments

Comments
 (0)