mirror of
https://github.com/langgenius/dify.git
synced 2026-05-02 08:28:03 +08:00
fix: no auth label text and default handle auth not back
This commit is contained in:
@ -318,7 +318,9 @@ const ToolBlockComponent: FC<ToolBlockComponentProps> = ({
|
||||
})()
|
||||
|
||||
const needAuthorization = useMemo(() => {
|
||||
return !currentProvider?.is_team_authorization
|
||||
if (!currentProvider)
|
||||
return false
|
||||
return !currentProvider.is_team_authorization
|
||||
}, [currentProvider])
|
||||
|
||||
const renderIcon = () => {
|
||||
@ -529,7 +531,7 @@ const ToolBlockComponent: FC<ToolBlockComponentProps> = ({
|
||||
}}
|
||||
>
|
||||
{renderIcon()}
|
||||
<span className={cn('system-xs-medium max-w-[180px] truncate', needAuthorization ? 'text-text-secondary' : 'text-text-accent')}>
|
||||
<span className={cn('system-xs-medium max-w-[180px] truncate', needAuthorization ? 'text-text-warning' : 'text-text-accent')}>
|
||||
{displayLabel}
|
||||
</span>
|
||||
{needAuthorization && (
|
||||
|
||||
@ -295,7 +295,9 @@ const ToolGroupBlockComponent: FC<ToolGroupBlockComponentProps> = ({
|
||||
}, [currentTool, defaultToolValue, toolConfigFromMetadata])
|
||||
|
||||
const needAuthorization = useMemo(() => {
|
||||
return !currentProvider?.is_team_authorization
|
||||
if (!currentProvider)
|
||||
return false
|
||||
return !currentProvider.is_team_authorization
|
||||
}, [currentProvider])
|
||||
|
||||
const readmeEntrance = useMemo(() => {
|
||||
@ -790,7 +792,7 @@ const ToolGroupBlockComponent: FC<ToolGroupBlockComponentProps> = ({
|
||||
}}
|
||||
>
|
||||
{renderIcon()}
|
||||
<span className={cn('system-xs-medium max-w-[160px] truncate', needAuthorization ? 'text-text-secondary' : 'text-text-accent')}>
|
||||
<span className={cn('system-xs-medium max-w-[160px] truncate', needAuthorization ? 'text-text-warning' : 'text-text-accent')}>
|
||||
{providerLabel}
|
||||
</span>
|
||||
{needAuthorization
|
||||
|
||||
Reference in New Issue
Block a user