This repository was archived by the owner on Sep 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +131
-144
lines changed Expand file tree Collapse file tree 2 files changed +131
-144
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ if (!isDev) {
21
21
if ( gotTheLock ) {
22
22
app . on ( 'second-instance' , ( ) => {
23
23
// Someone tried to run a second instance, we should focus our window.
24
- if ( mainWindow && mainWindow . isMinimized ( ) ) {
24
+ if ( mainWindow ? .isMinimized ( ) ) {
25
25
mainWindow . restore ( )
26
26
}
27
27
mainWindow . focus ( )
@@ -65,8 +65,6 @@ function createWindow() {
65
65
show : false ,
66
66
} )
67
67
68
- // eslint-disable-next-line
69
-
70
68
// load root file/url
71
69
if ( isDev ) {
72
70
mainWindow . loadURL ( 'http://localhost:9080' )
@@ -89,31 +87,30 @@ function createWindow() {
89
87
} )
90
88
mainWindow . webContents . on ( 'context-menu' , ( e , props ) => {
91
89
const InputMenu = Menu . buildFromTemplate ( [ {
92
- label : 'Undo' ,
93
- role : 'undo' ,
90
+ label : 'Undo' ,
91
+ role : 'undo' ,
94
92
} , {
95
- label : 'Redo' ,
96
- role : 'redo' ,
93
+ label : 'Redo' ,
94
+ role : 'redo' ,
97
95
} , {
98
- type : 'separator' ,
96
+ type : 'separator' ,
99
97
} , {
100
- label : 'Cut' ,
101
- role : 'cut' ,
98
+ label : 'Cut' ,
99
+ role : 'cut' ,
102
100
} , {
103
- label : 'Copy' ,
104
- role : 'copy' ,
101
+ label : 'Copy' ,
102
+ role : 'copy' ,
105
103
} , {
106
- label : 'Paste' ,
107
- role : 'paste' ,
104
+ label : 'Paste' ,
105
+ role : 'paste' ,
108
106
} , {
109
- type : 'separator' ,
107
+ type : 'separator' ,
110
108
} , {
111
- label : 'Select all' ,
112
- role : 'selectall' ,
109
+ label : 'Select all' ,
110
+ role : 'selectall' ,
113
111
} ,
114
112
] ) ;
115
- const { inputFieldType } = props ;
116
- if ( inputFieldType === 'plainText' ) {
113
+ if ( props ?. inputFieldType === 'plainText' ) {
117
114
InputMenu . popup ( mainWindow ) ;
118
115
}
119
116
} ) ;
You can’t perform that action at this time.
0 commit comments