From 346f06a03092c49bc0c494e6fe75c93304bd3890 Mon Sep 17 00:00:00 2001 From: Brian Ingles Date: Wed, 3 Apr 2024 10:53:46 -0500 Subject: [PATCH] Handling non-table exported object (#293) --- plugins/ui/src/js/src/elements/Picker.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/ui/src/js/src/elements/Picker.tsx b/plugins/ui/src/js/src/elements/Picker.tsx index dc4d36ae5..d7b1b74ef 100644 --- a/plugins/ui/src/js/src/elements/Picker.tsx +++ b/plugins/ui/src/js/src/elements/Picker.tsx @@ -25,10 +25,13 @@ function Picker({ children, ...props }: PickerProps) { const isObjectView = isElementOfType(children, ObjectView); - const maybeExportedObject = isObjectView ? children.props.object : null; + const maybeExportedTable = + isObjectView && children.props.object.type === 'Table' + ? children.props.object + : null; const { data: table } = usePromiseFactory(fetchReexportedTable, [ - maybeExportedObject, + maybeExportedTable, ]); useTableClose(table);