mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-22 05:30:19 +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}
|
||||
placeholder="us-west-2"
|
||||
onChange={(e) =>
|
||||
accessStore.update(
|
||||
(access) => (access.awsRegion = e.currentTarget.value),
|
||||
)
|
||||
accessStore.update((access) => {
|
||||
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>
|
||||
|
Loading…
Reference in New Issue
Block a user