File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -7,30 +7,18 @@ import { setAutoLauch } from "./lib/auto-launch";
7
7
import { initBreaks } from "./lib/breaks" ;
8
8
import "./lib/ipc" ;
9
9
import { showNotification } from "./lib/notifications" ;
10
- import {
11
- getAppInitialized ,
12
- setAppInitialized ,
13
- setBreaksEnabled
14
- } from "./lib/store" ;
10
+ import { getAppInitialized , setAppInitialized } from "./lib/store" ;
15
11
import { initTray } from "./lib/tray" ;
16
12
import { createSettingsWindow , createSoundsWindow } from "./lib/windows" ;
17
13
18
14
const gotTheLock = app . requestSingleInstanceLock ( ) ;
19
15
20
- if ( ! gotTheLock ) {
21
- const cliArg = process . argv [ process . argv . length - 1 ] ;
22
-
23
- if ( cliArg === "disable" ) {
24
- console . log ( "breaks disabled" ) ;
25
- setBreaksEnabled ( false ) ;
26
- } else if ( cliArg === "enable" ) {
27
- console . log ( "breaks enabled" ) ;
28
- setBreaksEnabled ( true ) ;
29
- } else {
30
- console . log ( "app already open, opening settings" ) ;
31
- createSettingsWindow ( ) ;
32
- }
16
+ app . on ( "second-instance" , ( ) => {
17
+ createSettingsWindow ( ) ;
18
+ } ) ;
33
19
20
+ if ( ! gotTheLock ) {
21
+ log . info ( "app already running" ) ;
34
22
app . exit ( ) ;
35
23
}
36
24
You can’t perform that action at this time.
0 commit comments