File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ Phoenix.app = {
299299 if ( handlerFn ) {
300300 singleInstanceCLIHandler = handlerFn ;
301301 }
302- if ( Phoenix . isNativeApp ) {
302+ if ( window . __TAURI__ ) {
303303 window . __TAURI__ . event . listen ( "single-instance" , ( { payload} ) => {
304304 handlerFn ( payload . args , payload . cwd ) ;
305305 } ) ;
@@ -338,6 +338,13 @@ Phoenix.app = {
338338 window . __TAURI__ . event . emit ( 'scheme-request-received' , { fileURLArray : filesURLList } ) ;
339339 } ) ;
340340 } ) ;
341+ } else if ( window . __ELECTRON__ ) {
342+ // Listen for single instance event from main process
343+ window . electronAPI . onSingleInstance ( ( payload ) => {
344+ handlerFn ( payload . args , payload . cwd ) ;
345+ } ) ;
346+ // macOS deep linking (scheme-request-received, get_mac_deep_link_requests) not implemented for Electron yet
347+ // Implement macOS open-with handling when needed. we dont have a electron edge now in mac/windows.
341348 }
342349 } ,
343350 clipboardReadText : function ( ) {
You can’t perform that action at this time.
0 commit comments