Skip to content

Commit 9378fa4

Browse files
authored
fix: Allow undefined for useTablePlugin irisGridUtils (#2515)
Small thing needed for ui.resolve b/c the JS API may not be available on mount of `UITable`, so `irisGridUtils` may be null This won't affect any rendering of table plugins since `model` is also required and possibly undefined until the JS API and table are loaded.
1 parent 9cfa2c3 commit 9378fa4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/dashboard-core-plugins/src/useTablePlugin.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface UseTablePluginProps {
2626
/**
2727
* A IrisGridUtils instance.
2828
*/
29-
irisGridUtils: IrisGridUtils;
29+
irisGridUtils: IrisGridUtils | undefined;
3030
/**
3131
* The currently selected ranges in the grid.
3232
*/
@@ -56,7 +56,9 @@ export function useTablePlugin({
5656
const [pluginFilters, setPluginFilters] = useState<InputFilter[]>([]);
5757
const customFilters = useMemo(
5858
() =>
59-
model != null && isIrisGridTableModelTemplate(model)
59+
model != null &&
60+
irisGridUtils != null &&
61+
isIrisGridTableModelTemplate(model)
6062
? irisGridUtils.getFiltersFromInputFilters(
6163
model.table.columns,
6264
pluginFilters,

0 commit comments

Comments
 (0)