Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect argument type for Filepicker onSelect #56

Open
zgeorgebrandcoders opened this issue Nov 29, 2023 · 0 comments
Open

Incorrect argument type for Filepicker onSelect #56

zgeorgebrandcoders opened this issue Nov 29, 2023 · 0 comments

Comments

@zgeorgebrandcoders
Copy link

onSelect supplies you with the selected file from whatever integration you were interacting with as an argument to the callback you define. The type for the argument says that it is a native JS File type, but this doesn't match what is actually returned. The object that came back doesn't sufficiently overlap with the native File type.

Steps to reproduce:

  1. Authenticate with Google Drive from the file picker
  2. Select a file
  3. console.log() what is being passed to the onSelect function
onSelect: (file) => {
  console.log(file)
}

Example of what object I'm receiving:

{
  "id": "-redacted-",
  "type": "file",
  "mime_type": "-redacted-",
  "name": "-redacted-",
  "size": 0,
  "downloadable": true,
  "owner": {
    "id": "-redacted-",
    "email": "-redacted-",
    "name": "-redacted-"
  },
  "parent_folders": [
    {
      "id": "-redacted-"
    }
  ],
  "parent_folders_complete": false,
  "permissions": {
    "download": true
  },
  "exportable": false,
  "export_formats": [],
  "created_at": "2023-11-27T16:30:03.266Z",
  "created_by": "01702477334330046076",
  "updated_at": "2023-11-27T16:30:03.266Z",
  "updated_by": "01702477334330046076"
}

Example of JS File type:

{
 "lastModified": 0
 "name": "-redacted-"
 "size": 0
 "type": "-redacted-"
 "webkitRelativePath": "-redacted-"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant