File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,16 +84,16 @@ export const initSingleInstanceHandle = () => {
8484 }
8585
8686 app . on ( 'second-instance' , ( event , argv , cwd ) => {
87- for ( const param of argv ) {
88- if ( URL_SCHEME_RXP . test ( param ) ) {
89- global . envParams . deeplink = param
90- break
91- }
92- }
93-
9487 if ( isExistMainWindow ( ) ) {
95- if ( global . envParams . deeplink ) global . lx . event_app . deeplink ( global . envParams . deeplink )
96- else showMainWindow ( )
88+ const envParams = parseEnvParams ( argv )
89+ if ( envParams . deeplink ) {
90+ global . envParams . deeplink = envParams . deeplink
91+ global . lx . event_app . deeplink ( global . envParams . deeplink )
92+ return
93+ }
94+ if ( envParams . cmdParams . hidden !== true ) {
95+ showMainWindow ( )
96+ }
9797 } else {
9898 app . quit ( )
9999 }
Original file line number Diff line number Diff line change @@ -9,11 +9,11 @@ import { nativeTheme, powerSaveBlocker } from 'electron'
99import { joinPath } from '@common/utils/nodejs'
1010import themes from '@common/theme/index.json'
1111
12- export const parseEnvParams = ( ) : { cmdParams : LX . CmdParams , deeplink : string | null } => {
12+ export const parseEnvParams = ( argv = process . argv ) : { cmdParams : LX . CmdParams , deeplink : string | null } => {
1313 const cmdParams : LX . CmdParams = { }
1414 let deeplink = null
1515 const rx = / ^ - \w + /
16- for ( let param of process . argv ) {
16+ for ( let param of argv ) {
1717 if ( URL_SCHEME_RXP . test ( param ) ) {
1818 deeplink = param
1919 }
You can’t perform that action at this time.
0 commit comments