Skip to content

Commit

Permalink
Fix "files is not defined" error in S3 object picker
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Sep 30, 2024
1 parent 3f31c1a commit 415301d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const S3ObjectPicker = ({
case ChonkyActions.ChangeSelection.id:
if (
action.payload.selection.size == 0 &&
files.find(({ id }) => selectedFile == id)
files?.find(({ id }) => selectedFile == id)
) {
fileBrowserRef.current.setFileSelection(new Set([selectedFile]));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const S3ObjectProvider = forwardRef(
useImperativeHandle(ref, () => ({
findFileSetByUri: (value) => {
const objects = data?.ListIngestBucketObjects?.objects;
if (!objects) return null;
const found = objects?.find(({ uri }) => uri == value);
if (!found) return null;

const found = objects.find(({ uri }) => uri == value);
return { ...found, key: found.uri, uri: undefined };
},
}));
Expand Down

0 comments on commit 415301d

Please sign in to comment.