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

Adding support to show shared drives on the picker #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default function useDrivePicker(): [
setIncludeFolders,
setSelectFolderEnabled,
disableDefaultView = false,
setEnableDrives,
callbackFunction,
}: PickerConfiguration) => {
if (disabled) return false
Expand All @@ -126,6 +127,7 @@ export default function useDrivePicker(): [
if (viewMimeTypes) view.setMimeTypes(viewMimeTypes)
if (setIncludeFolders) view.setIncludeFolders(true)
if (setSelectFolderEnabled) view.setSelectFolderEnabled(true)
if (setEnableDrives) view.setEnableDrives(true)

const uploadView = new google.picker.DocsUploadView()
if (viewMimeTypes) uploadView.setMimeTypes(viewMimeTypes)
Expand Down
15 changes: 8 additions & 7 deletions src/typeDefs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export type PickerCallback = {
docs: CallbackDoc[]
}

export type authResult = {
access_token: string;
token_type: string;
expires_in: number;
scope: string;
authuser: string;
prompt: string;
export type authResult = {
access_token: string
token_type: string
expires_in: number
scope: string
authuser: string
prompt: string
}

type ViewIdOptions =
Expand Down Expand Up @@ -66,6 +66,7 @@ export type PickerConfiguration = {
customViews?: any[]
locale?: string
customScopes?: string[]
setEnableDrives?: boolean
callbackFunction: (data: PickerCallback) => any
}

Expand Down