Update hook to fetch index pattern. (#67146)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
75d6682d86
commit
5b153eca6e
|
@ -14,10 +14,10 @@ export const useIndexPattern = () => {
|
|||
const indexPattern = useSelector(selectIndexPattern);
|
||||
|
||||
useEffect(() => {
|
||||
if (!indexPattern) {
|
||||
if (!indexPattern.index_pattern) {
|
||||
dispatch(getIndexPattern());
|
||||
}
|
||||
}, [indexPattern, dispatch]);
|
||||
}, [indexPattern.index_pattern, dispatch]);
|
||||
|
||||
return indexPattern;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue