Load more data when navigating in WikiTree

This commit is contained in:
Przemek Wiech
2020-01-25 21:42:50 +01:00
parent d4bd801980
commit 48cfb221f3
5 changed files with 92 additions and 19 deletions

View File

@@ -164,6 +164,8 @@ export class Chart extends React.PureComponent<ChartProps, {}> {
updateSvgSize: false,
locale: this.context.intl.locale,
});
} else {
this.chart!.setData(this.props.data);
}
const chartInfo = this.chart!.render({
startIndi: this.props.selection.id,
@@ -227,9 +229,7 @@ export class Chart extends React.PureComponent<ChartProps, {}> {
}
componentDidUpdate(prevProps: ChartProps) {
const initialRender =
this.props.data !== prevProps.data ||
this.props.chartType !== prevProps.chartType;
const initialRender = this.props.chartType !== prevProps.chartType;
this.renderChart({initialRender});
}