mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-11 18:05:58 +00:00
Prefill IM channel runtime config
This commit is contained in:
@@ -57,6 +57,10 @@ export function ChannelRuntimeConfigDialog({
|
||||
() => provider?.credential_fields ?? [],
|
||||
[provider?.credential_fields],
|
||||
);
|
||||
const credentialValues = useMemo<ChannelRuntimeConfigValues>(
|
||||
() => provider?.credential_values ?? {},
|
||||
[provider?.credential_values],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || !provider) {
|
||||
@@ -64,11 +68,14 @@ export function ChannelRuntimeConfigDialog({
|
||||
return;
|
||||
}
|
||||
setValues(
|
||||
Object.fromEntries(fields.map((field) => [field.name, ""])) as
|
||||
| ChannelRuntimeConfigValues
|
||||
| {},
|
||||
Object.fromEntries(
|
||||
fields.map((field) => [
|
||||
field.name,
|
||||
credentialValues[field.name] ?? "",
|
||||
]),
|
||||
) as ChannelRuntimeConfigValues,
|
||||
);
|
||||
}, [fields, open, provider]);
|
||||
}, [credentialValues, fields, open, provider]);
|
||||
|
||||
if (!provider) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user