@@ -71,6 +71,8 @@ import { circomPlugin } from './app/plugins/electron/circomElectronPlugin'
71
71
import { GitHubAuthHandler } from './app/plugins/electron/gitHubAuthHandler'
72
72
import { GitPlugin } from './app/plugins/git'
73
73
import { Matomo } from './app/plugins/matomo'
74
+ import { DesktopClient } from './app/plugins/desktop-client'
75
+ import { DesktopHost } from './app/plugins/electron/desktopHostPlugin'
74
76
import { WalletConnect } from './app/plugins/walletconnect'
75
77
76
78
import { TemplatesSelectionPlugin } from './app/plugins/templates-selection/templates-selection-plugin'
@@ -153,6 +155,8 @@ class AppComponent {
153
155
popupPanel : PopupPanel
154
156
statusBar : StatusBar
155
157
settings : SettingsTab
158
+ params : any
159
+ desktopClientMode : boolean
156
160
constructor ( ) {
157
161
const PlatFormAPi = new platformApi ( )
158
162
Registry . getInstance ( ) . put ( {
@@ -161,6 +165,8 @@ class AppComponent {
161
165
} )
162
166
this . appManager = new RemixAppManager ( )
163
167
this . queryParams = new QueryParams ( )
168
+ this . params = this . queryParams . get ( )
169
+ this . desktopClientMode = this . params && this . params . activate && this . params . activate . split ( ',' ) . includes ( 'desktopClient' )
164
170
this . _components = { } as Components
165
171
// setup storage
166
172
const configStorage = new Storage ( 'config-v0.8:' )
@@ -473,8 +479,14 @@ class AppComponent {
473
479
this . engine . register ( [ appUpdater ] )
474
480
const remixAIDesktop = new remixAIDesktopPlugin ( )
475
481
this . engine . register ( [ remixAIDesktop ] )
482
+ const desktopHost = new DesktopHost ( )
483
+ this . engine . register ( [ desktopHost ] )
476
484
const githubAuthHandler = new GitHubAuthHandler ( )
477
485
this . engine . register ( [ githubAuthHandler ] )
486
+ } else {
487
+ //---- desktop client
488
+ const desktopClient = new DesktopClient ( blockchain )
489
+ this . engine . register ( [ desktopClient ] )
478
490
}
479
491
480
492
const compilerloader = isElectron ( ) ? new compilerLoaderPluginDesktop ( ) : new compilerLoaderPlugin ( )
@@ -563,8 +575,6 @@ class AppComponent {
563
575
}
564
576
565
577
async activate ( ) {
566
- const queryParams = new QueryParams ( )
567
- const params : any = queryParams . get ( )
568
578
569
579
try {
570
580
this . engine . register ( await this . appManager . registeredPlugins ( ) )
@@ -642,13 +652,13 @@ class AppComponent {
642
652
. activatePlugin ( this . workspace )
643
653
. then ( async ( ) => {
644
654
try {
645
- if ( params . deactivate ) {
646
- await this . appManager . deactivatePlugin ( params . deactivate . split ( ',' ) )
655
+ if ( this . params . deactivate ) {
656
+ await this . appManager . deactivatePlugin ( this . params . deactivate . split ( ',' ) )
647
657
}
648
658
} catch ( e ) {
649
659
console . log ( e )
650
660
}
651
- if ( params . code && ( ! params . activate || params . activate . split ( ',' ) . includes ( 'solidity' ) ) ) {
661
+ if ( this . params . code && ( ! this . params . activate || this . params . activate . split ( ',' ) . includes ( 'solidity' ) ) ) {
652
662
// if code is given in url we focus on solidity plugin
653
663
this . menuicons . select ( 'solidity' )
654
664
} else {
@@ -660,19 +670,19 @@ class AppComponent {
660
670
}
661
671
}
662
672
663
- if ( params . call ) {
664
- const callDetails : any = params . call . split ( '//' )
673
+ if ( this . params . call ) {
674
+ const callDetails = this . params . call . split ( '//' )
665
675
if ( callDetails . length > 1 ) {
666
676
this . appManager . call ( 'notification' , 'toast' , `initiating ${ callDetails [ 0 ] } and calling "${ callDetails [ 1 ] } " ...` )
667
677
// @todo (remove the timeout when activatePlugin is on 0.3.0)
668
- _paq . push ( [ 'trackEvent' , 'App' , 'queryParams-calls' , params . call ] )
678
+ _paq . push ( [ 'trackEvent' , 'App' , 'queryParams-calls' , this . params . call ] )
669
679
//@ts -ignore
670
680
await this . appManager . call ( ...callDetails ) . catch ( console . error )
671
681
}
672
682
}
673
683
674
- if ( params . calls ) {
675
- const calls = params . calls . split ( '///' )
684
+ if ( this . params . calls ) {
685
+ const calls = this . params . calls . split ( '///' )
676
686
677
687
// call all functions in the list, one after the other
678
688
for ( const call of calls ) {
@@ -717,6 +727,10 @@ class AppComponent {
717
727
718
728
// activate solidity plugin
719
729
this . appManager . activatePlugin ( [ 'solidity' , 'udapp' , 'deploy-libraries' , 'link-libraries' , 'openzeppelin-proxy' , 'scriptRunnerBridge' ] )
730
+
731
+ if ( isElectron ( ) ) {
732
+ this . appManager . activatePlugin ( [ 'desktopHost' ] )
733
+ }
720
734
}
721
735
}
722
736
0 commit comments