fix(dashboard): Fix FilterWithDataMask typing and add null check (#22260)

This commit is contained in:
Cody Leff 2022-11-29 11:40:09 -07:00 committed by GitHub
parent fb3e717573
commit a642d126f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ export type Filter = {
description: string;
};
export type FilterWithDataMask = Filter & { dataMask: DataMaskWithId };
export type FilterWithDataMask = Filter & { dataMask?: DataMaskWithId };
export type Divider = Partial<Omit<Filter, 'id' | 'type'>> & {
id: string;

View File

@ -128,7 +128,7 @@ const FilterControls: FC<FilterControlsProps> = ({
const activeOverflowedFiltersInScope = useMemo(
() =>
overflowedFiltersInScope.filter(
filter => isNativeFilter(filter) && filter.dataMask.filterState?.value,
filter => isNativeFilter(filter) && filter.dataMask?.filterState?.value,
).length,
[overflowedFiltersInScope],
);