@@ -144,18 +144,20 @@ main = silence $ do
144
144
-- XXX: In a special case, when `cardano-launcher` is given a
145
145
-- `mURL` (web+cardano://…) on the command line, we want to
146
146
-- allow the second instance. Then, Daedalus will notify its
147
- -- first instance to handle this particular URL. This needs to
148
- -- happen only on Linux and Windows, since macOS has its own
149
- -- mechanism to notify already running applications to open
150
- -- URLs, which Electron implements. In such a case, we also
151
- -- skip TLS setup.
147
+ -- first instance to handle this particular URL using internal
148
+ -- Electron mechanism. This must happen on Linux and Windows,
149
+ -- since macOS has its own mechanism to notify already running
150
+ -- applications to open URLs, which Electron implements. But
151
+ -- it’s nice to have on macOS as well, since the user can
152
+ -- still run Daedalus from a terminal. In second instance, we
153
+ -- also skip the TLS setup (Daedalus won’t start 2nd cardano).
152
154
--
153
155
-- Otherwise, will throw an exception if the application is
154
156
-- already running.
155
- (isSecondWindowsInstanceWithURL , lockHandle) <- E. try (checkIfApplicationIsRunning lockFile) >>= \ case
157
+ (isSecondInstanceWithURL , lockHandle) <- E. try (checkIfApplicationIsRunning lockFile) >>= \ case
156
158
Right hndl -> pure (False , Just hndl)
157
159
Left exception@ ApplicationAlreadyRunningException ->
158
- if isJust mURL && ( OS. buildOS == OS. Windows || OS. buildOS == OS. Linux ) then
160
+ if isJust mURL then
159
161
pure (True , Nothing )
160
162
else
161
163
throwM exception
@@ -171,7 +173,7 @@ main = silence $ do
171
173
172
174
-- Configuration from the launcher options.
173
175
let mTlsConfig :: Maybe TLSConfiguration
174
- mTlsConfig = if isSecondWindowsInstanceWithURL then Nothing else loTlsConfig launcherOptions
176
+ mTlsConfig = if isSecondInstanceWithURL then Nothing else loTlsConfig launcherOptions
175
177
176
178
let daedalusBin :: DaedalusBin
177
179
daedalusBin = getDPath launcherOptions
0 commit comments