Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/src/components/UASTViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class UASTViewer extends Component {

this.state = {
loading: false,
flatUast: this.transform(props.uast),
initialFlatUast: this.transform(props.uast),
showLocations: false,
filter: '',
error: null
Expand Down Expand Up @@ -65,9 +65,9 @@ class UASTViewer extends Component {
}

render() {
const { flatUast, error, loading } = this.state;
const { initialFlatUast, error, loading } = this.state;
const { showLocations, filter } = this.state;
const uastViewerProps = { flatUast };
const uastViewerProps = { initialFlatUast };

return (
<div className="pg-uast-viewer">
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/UASTViewerPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ function UASTViewerPane({
}) {
let content = null;

const uast = uastViewerProps.flatUast || uastViewerProps.initialFlatUast;
if (loading) {
content = <div>loading...</div>;
} else if (uastViewerProps.flatUast) {
const searchResults = getSearchResults(uastViewerProps.flatUast);
} else if (uast) {
const searchResults = getSearchResults(uast);
const rootIds = searchResults || [ROOT_ID];

if (searchResults && !searchResults.length) {
Expand Down