mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(sheets): file selector had incorrect provider (#1958)
This commit is contained in:
committed by
GitHub
parent
766c7fbfbb
commit
74202ce1fc
@@ -87,9 +87,11 @@ export function FileSelectorInput({
|
||||
const foreignCheckProvider = subBlock.serviceId
|
||||
? getProviderIdFromServiceId(subBlock.serviceId)
|
||||
: (subBlock.provider as string) || ''
|
||||
const normalizedCredentialId = coerceToIdString(connectedCredential)
|
||||
const providerForForeignCheck = foreignCheckProvider || (subBlock.provider as string) || undefined
|
||||
const { isForeignCredential } = useForeignCredential(
|
||||
subBlock.provider || subBlock.serviceId || 'outlook',
|
||||
(connectedCredential as string) || ''
|
||||
providerForForeignCheck,
|
||||
normalizedCredentialId
|
||||
)
|
||||
|
||||
// Get provider-specific values
|
||||
@@ -123,8 +125,7 @@ export function FileSelectorInput({
|
||||
|
||||
const credentialDependencySatisfied = (() => {
|
||||
if (!dependsOn.includes('credential')) return true
|
||||
const normalizedCredential = coerceToIdString(connectedCredential)
|
||||
if (!normalizedCredential || normalizedCredential.trim().length === 0) {
|
||||
if (!normalizedCredentialId || normalizedCredentialId.trim().length === 0) {
|
||||
return false
|
||||
}
|
||||
if (isForeignCredential) {
|
||||
|
||||
@@ -17,7 +17,7 @@ export function useForeignCredential(
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
if (!normalizedCredentialId) {
|
||||
if (!normalizedProvider || !normalizedCredentialId) {
|
||||
if (!cancelled) setIsForeign(false)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
|
||||
title: 'Select Sheet',
|
||||
type: 'file-selector',
|
||||
canonicalParamId: 'spreadsheetId',
|
||||
provider: 'google-drive',
|
||||
serviceId: 'google-drive',
|
||||
provider: 'google-sheets',
|
||||
serviceId: 'google-sheets',
|
||||
requiredScopes: [
|
||||
'https://www.googleapis.com/auth/drive.readonly',
|
||||
'https://www.googleapis.com/auth/drive.file',
|
||||
|
||||
Reference in New Issue
Block a user