File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class UASTViewer extends Component {
1616
1717 this . state = {
1818 loading : false ,
19- flatUast : this . transform ( props . uast ) ,
19+ initialFlatUast : this . transform ( props . uast ) ,
2020 showLocations : false ,
2121 filter : '' ,
2222 error : null
@@ -65,9 +65,9 @@ class UASTViewer extends Component {
6565 }
6666
6767 render ( ) {
68- const { flatUast , error, loading } = this . state ;
68+ const { initialFlatUast , error, loading } = this . state ;
6969 const { showLocations, filter } = this . state ;
70- const uastViewerProps = { flatUast } ;
70+ const uastViewerProps = { initialFlatUast } ;
7171
7272 return (
7373 < div className = "pg-uast-viewer" >
Original file line number Diff line number Diff line change @@ -41,10 +41,11 @@ function UASTViewerPane({
4141} ) {
4242 let content = null ;
4343
44+ const uast = uastViewerProps . flatUast || uastViewerProps . initialFlatUast ;
4445 if ( loading ) {
4546 content = < div > loading...</ div > ;
46- } else if ( uastViewerProps . flatUast ) {
47- const searchResults = getSearchResults ( uastViewerProps . flatUast ) ;
47+ } else if ( uast ) {
48+ const searchResults = getSearchResults ( uast ) ;
4849 const rootIds = searchResults || [ ROOT_ID ] ;
4950
5051 if ( searchResults && ! searchResults . length ) {
You can’t perform that action at this time.
0 commit comments