Change onOAuthChange to pass all OAuth fields together
Replace onOAuthChange(field, value) with onOAuthChange(oauth) where
oauth is { clientId, clientSecret, scopes }. Each keystroke now
reports the full OAuth state, not just the single field that changed.
This lets the consumer see the complete picture on every change.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e04befa4dd
commit
d27018b4f2
1 changed files with 44 additions and 20 deletions
|
|
@ -5,6 +5,7 @@ import { ListToggle } from "../../elements/ListToggle/ListToggle";
|
|||
import {
|
||||
ServerSettingsForm,
|
||||
type ServerSettingsSection,
|
||||
type OAuthSettings,
|
||||
} from "../ServerSettingsForm/ServerSettingsForm";
|
||||
|
||||
const ALL_SECTIONS: ServerSettingsSection[] = [
|
||||
|
|
@ -88,14 +89,13 @@ export function ServerSettingsModal({
|
|||
onSettingsChange({ ...settings, [field]: value });
|
||||
}
|
||||
|
||||
function handleOAuthChange(field: string, value: string) {
|
||||
const oauthFieldMap: Record<string, string> = {
|
||||
clientId: "oauthClientId",
|
||||
clientSecret: "oauthClientSecret",
|
||||
scopes: "oauthScopes",
|
||||
};
|
||||
const settingsKey = oauthFieldMap[field] ?? field;
|
||||
onSettingsChange({ ...settings, [settingsKey]: value });
|
||||
function handleOAuthChange(oauth: OAuthSettings) {
|
||||
onSettingsChange({
|
||||
...settings,
|
||||
oauthClientId: oauth.clientId,
|
||||
oauthClientSecret: oauth.clientSecret,
|
||||
oauthScopes: oauth.scopes,
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue