Skip to content

Commit

Permalink
fix(core): Improve rendering speed of details panel (#8506)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyhebebrand committed Aug 21, 2020
1 parent e822011 commit 5caf132
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions app/scripts/modules/core/src/insight/InsightLayout.tsx
Expand Up @@ -10,7 +10,6 @@ export interface IInsightLayoutProps {
}

export const InsightLayout = ({ app }: IInsightLayoutProps) => {
const [appIsReady, setAppIsReady] = React.useState(false);
const [expandFilters, setExpandFilters] = React.useState(ReactInjector.insightFilterStateModel.filtersExpanded);
const { filtersHidden } = ReactInjector.insightFilterStateModel;
const filterClass = expandFilters ? 'filters-expanded' : 'filters-collapsed';
Expand All @@ -23,10 +22,6 @@ export const InsightLayout = ({ app }: IInsightLayoutProps) => {
const { state: currentState } = useCurrentStateAndParams();
const showDetailsView = Boolean(Object.keys(currentState.views).find(v => v.indexOf('detail@') !== -1));

React.useEffect(() => {
app.ready().then(() => setAppIsReady(true));
}, []);

if (app.notFound || app.hasError) {
return null;
}
Expand All @@ -45,7 +40,7 @@ export const InsightLayout = ({ app }: IInsightLayoutProps) => {
)}
<div className="flex-1">
<UIView name="master" className="nav-content ng-scope" data-scroll-id="nav-content" />
{appIsReady && showDetailsView && (
{showDetailsView && (
<div>
<UIView name="detail" className="detail-content" />
</div>
Expand Down

0 comments on commit 5caf132

Please sign in to comment.