fix(ui) - clickmaps breaking when there no events loaded
This commit is contained in:
parent
0b999aa7bf
commit
f8d88d344c
1 changed files with 8 additions and 5 deletions
|
|
@ -21,7 +21,8 @@ interface Props {
|
|||
function PageInsightsPanel({
|
||||
filters, fetchInsights, events = [], insights, urlOptions, host, loading = true
|
||||
}: Props) {
|
||||
const [insightsFilters, setInsightsFilters] = useState(filters)
|
||||
const [insightsFilters, setInsightsFilters] = useState(filters)
|
||||
const defaultValue = (urlOptions && urlOptions[0]) ? urlOptions[0].value : ''
|
||||
|
||||
const onDateChange = (e) => {
|
||||
const { startDate, endDate, rangeValue } = e;
|
||||
|
|
@ -36,9 +37,11 @@ function PageInsightsPanel({
|
|||
}, [insights])
|
||||
|
||||
useEffect(() => {
|
||||
const url = insightsFilters.url ? insightsFilters.url : host + urlOptions[0].value;
|
||||
Player.pause();
|
||||
fetchInsights({ ...insightsFilters, url })
|
||||
if (urlOptions && urlOptions[0]) {
|
||||
const url = insightsFilters.url ? insightsFilters.url : host + urlOptions[0].value;
|
||||
Player.pause();
|
||||
fetchInsights({ ...insightsFilters, url })
|
||||
}
|
||||
}, [insightsFilters])
|
||||
|
||||
const onPageSelect = (e, { name, value }) => {
|
||||
|
|
@ -68,7 +71,7 @@ function PageInsightsPanel({
|
|||
selection
|
||||
options={ urlOptions }
|
||||
name="url"
|
||||
defaultValue={urlOptions[0].value}
|
||||
defaultValue={defaultValue}
|
||||
onChange={ onPageSelect }
|
||||
id="change-dropdown"
|
||||
className="customDropdown"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue