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 => {
44
44
if ( routes . length > 1 ) {
45
45
switch ( routes [ 0 ] ) {
46
46
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
49
47
dispatch ( updateActiveTab ( routes [ 1 ] ) ) ;
50
48
break ;
51
49
default :
Original file line number Diff line number Diff line change @@ -27,10 +27,15 @@ class ProjectSettingView {
27
27
}
28
28
29
29
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
+ } )
34
39
}
35
40
36
41
public async initializeWebview ( context : vscode . ExtensionContext ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments