mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
refactor(trigger): simplify provider path handling in workflow components
- Updated various components to directly use `provider.name` instead of constructing a path with `provider.plugin_id` and `provider.name`. - Adjusted related calls to `invalidateSubscriptions` and other functions to reflect this change. These modifications enhance code clarity and streamline the handling of provider information in the trigger plugin components.
This commit is contained in:
@ -241,8 +241,8 @@ const BasePanel: FC<BasePanelProps> = ({
|
||||
// For trigger plugins, check if they have existing subscriptions (authenticated)
|
||||
const triggerProvider = useMemo(() => {
|
||||
if (data.type === BlockEnum.TriggerPlugin) {
|
||||
if (data.provider_id && data.provider_name)
|
||||
return `${data.provider_id}/${data.provider_name}`
|
||||
if (data.provider_name)
|
||||
return data.provider_name
|
||||
return data.provider_id || ''
|
||||
}
|
||||
return ''
|
||||
|
||||
@ -32,11 +32,8 @@ const NodeAuth: FC<NodeAuthProps> = ({ data, onAuthorizationChange }) => {
|
||||
const provider = useMemo(() => {
|
||||
if (data.type === BlockEnum.TriggerPlugin) {
|
||||
// If we have both plugin_id and provider_name, construct the full path
|
||||
if (data.provider_id && data.provider_name)
|
||||
return `${data.provider_id}/${data.provider_name}`
|
||||
|
||||
// Otherwise use provider_id as fallback (might be already complete)
|
||||
return data.provider_id || ''
|
||||
if (data.provider_name)
|
||||
return data.provider_name
|
||||
}
|
||||
return data.provider_id || ''
|
||||
}, [data.type, data.provider_id, data.provider_name])
|
||||
|
||||
Reference in New Issue
Block a user