mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-22 13:40:16 +09:00
Add AWS region validation and improve code style.
This commit is contained in:
parent
bfa433919f
commit
70f066c15f
@ -978,9 +978,14 @@ export function Settings() {
|
|||||||
value={accessStore.awsRegion}
|
value={accessStore.awsRegion}
|
||||||
placeholder="us-west-2"
|
placeholder="us-west-2"
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
accessStore.update(
|
accessStore.update((access) => {
|
||||||
(access) => (access.awsRegion = e.currentTarget.value),
|
const region = e.currentTarget.value;
|
||||||
)
|
if (!/^[a-z]{2}-[a-z]+-\d+$/.test(region)) {
|
||||||
|
showToast(Locale.Settings.Access.Bedrock.Region.Invalid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
access.awsRegion = region;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
Loading…
Reference in New Issue
Block a user