Skip to content

Commit

Permalink
Handling non-table exported object (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Apr 3, 2024
1 parent 43e5c7d commit 346f06a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/ui/src/js/src/elements/Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 346f06a

Please sign in to comment.