Skip to content

Commit 74202ce

Browse files
fix(sheets): file selector had incorrect provider (#1958)
1 parent 766c7fb commit 74202ce

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/components/file-selector/file-selector-input.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ export function FileSelectorInput({
8787
const foreignCheckProvider = subBlock.serviceId
8888
? getProviderIdFromServiceId(subBlock.serviceId)
8989
: (subBlock.provider as string) || ''
90+
const normalizedCredentialId = coerceToIdString(connectedCredential)
91+
const providerForForeignCheck = foreignCheckProvider || (subBlock.provider as string) || undefined
9092
const { isForeignCredential } = useForeignCredential(
91-
subBlock.provider || subBlock.serviceId || 'outlook',
92-
(connectedCredential as string) || ''
93+
providerForForeignCheck,
94+
normalizedCredentialId
9395
)
9496

9597
// Get provider-specific values
@@ -123,8 +125,7 @@ export function FileSelectorInput({
123125

124126
const credentialDependencySatisfied = (() => {
125127
if (!dependsOn.includes('credential')) return true
126-
const normalizedCredential = coerceToIdString(connectedCredential)
127-
if (!normalizedCredential || normalizedCredential.trim().length === 0) {
128+
if (!normalizedCredentialId || normalizedCredentialId.trim().length === 0) {
128129
return false
129130
}
130131
if (isForeignCredential) {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/components/editor/components/sub-block/hooks/use-foreign-credential.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function useForeignCredential(
1717
setLoading(true)
1818
setError(null)
1919
try {
20-
if (!normalizedCredentialId) {
20+
if (!normalizedProvider || !normalizedCredentialId) {
2121
if (!cancelled) setIsForeign(false)
2222
return
2323
}

apps/sim/blocks/blocks/google_sheets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
4848
title: 'Select Sheet',
4949
type: 'file-selector',
5050
canonicalParamId: 'spreadsheetId',
51-
provider: 'google-drive',
52-
serviceId: 'google-drive',
51+
provider: 'google-sheets',
52+
serviceId: 'google-sheets',
5353
requiredScopes: [
5454
'https://www.googleapis.com/auth/drive.readonly',
5555
'https://www.googleapis.com/auth/drive.file',

0 commit comments

Comments
 (0)