File tree 2 files changed +6
-5
lines changed
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 {
16
16
17
17
this . state = {
18
18
loading : false ,
19
- flatUast : this . transform ( props . uast ) ,
19
+ initialFlatUast : this . transform ( props . uast ) ,
20
20
showLocations : false ,
21
21
filter : '' ,
22
22
error : null
@@ -65,9 +65,9 @@ class UASTViewer extends Component {
65
65
}
66
66
67
67
render ( ) {
68
- const { flatUast , error, loading } = this . state ;
68
+ const { initialFlatUast , error, loading } = this . state ;
69
69
const { showLocations, filter } = this . state ;
70
- const uastViewerProps = { flatUast } ;
70
+ const uastViewerProps = { initialFlatUast } ;
71
71
72
72
return (
73
73
< div className = "pg-uast-viewer" >
Original file line number Diff line number Diff line change @@ -41,10 +41,11 @@ function UASTViewerPane({
41
41
} ) {
42
42
let content = null ;
43
43
44
+ const uast = uastViewerProps . flatUast || uastViewerProps . initialFlatUast ;
44
45
if ( loading ) {
45
46
content = < div > loading...</ div > ;
46
- } else if ( uastViewerProps . flatUast ) {
47
- const searchResults = getSearchResults ( uastViewerProps . flatUast ) ;
47
+ } else if ( uast ) {
48
+ const searchResults = getSearchResults ( uast ) ;
48
49
const rootIds = searchResults || [ ROOT_ID ] ;
49
50
50
51
if ( searchResults && ! searchResults . length ) {
You can’t perform that action at this time.
0 commit comments