File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,6 @@ const ProjectSettingView = (): JSX.Element => {
4444 if ( routes . length > 1 ) {
4545 switch ( routes [ 0 ] ) {
4646 case SectionId . Classpath :
47- // TODO: sometimes when directly trigger 'Configure Java Runtime', the tab won't
48- // focus to the JDK part, need to investigate
4947 dispatch ( updateActiveTab ( routes [ 1 ] ) ) ;
5048 break ;
5149 default :
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ class ProjectSettingView {
2727 }
2828
2929 projectSettingsPanel . reveal ( ) ;
30- projectSettingsPanel . webview . postMessage ( {
31- command : "main.onWillChangeRoute" ,
32- route : sectionId
33- } ) ;
30+ const oneTimeHook = projectSettingsPanel . webview . onDidReceiveMessage ( ( ) => {
31+ // send the route change msg once react component is ready.
32+ // and dispose it once it's done.
33+ projectSettingsPanel ! . webview . postMessage ( {
34+ command : "main.onWillChangeRoute" ,
35+ route : sectionId
36+ } ) ;
37+ oneTimeHook . dispose ( ) ;
38+ } )
3439 }
3540
3641 public async initializeWebview ( context : vscode . ExtensionContext ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments