0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 00:47:50 +01:00

update conditional - only show skeleton if both groups are loading

This commit is contained in:
kunal 2021-05-18 10:27:57 -07:00
parent b5421a8f8e
commit bc9c3413bf
2 changed files with 2 additions and 4 deletions

View File

@ -125,7 +125,7 @@ export const InsightHistoryPanel: React.FC<InsightHistoryPanelProps> = ({ displa
const { reportInsightHistoryItemClicked } = useActions(eventUsageLogic)
const [activeTab, setActiveTab] = useState(
insights?.length < 3 && teamInsights?.length > insights?.length
!insightsLoading && insights?.length < 3 && teamInsights?.length > insights?.length
? InsightHistoryType.TEAM
: InsightHistoryType.RECENT
)

View File

@ -181,9 +181,7 @@ export function DiscoverInsightsModule(): JSX.Element {
</Title>
<Divider />
<Skeleton
loading={
(insightsLoading && insights.length === 0) || (teamInsightsLoading && teamInsights.length === 0)
}
loading={insightsLoading && insights.length === 0 && teamInsightsLoading && teamInsights.length === 0}
>
<Space direction={'vertical'} className={'home-page'} size={'small'}>
{(insights.length > 0 || teamInsights.length > 0) && <RecentInsightList />}