Merge branch 'main' into quest-file

This commit is contained in:
Lin, Hung-Shin committed 2023-11-22 11:39:24 +08:00
commit 21ca083628
46 files changed
+653 -220

No files matched your search

+8 -4
View File
@@ -8,21 +8,24 @@ import { checkUsername, chooseUsername } from '../utils/auth'
async function check({ username, error }) {
if (username) {
if (!isValidUsername(username)) {
error('Invalid username.')
// error('Invalid username.')
error('無效的帳號名稱')
return
}
try {
await checkUsername(username)
} catch (err) {
if (err instanceof TooManyRequestsError) {
error('Too many requests. Try again in 2 minutes.')
// error('Too many requests. Try again in 2 minutes.')
error('太多請求,兩分鐘後再試一次。')
return
}
if (err instanceof ValidationError) {
error(err.message)
return
}
error('Something went wrong. Please try again later.')
// error('Something went wrong. Please try again later.')
error('出了點問題,請再試一次。')
}
}
}
@@ -33,7 +36,8 @@ async function handleSubmit({ username, success, error }) {
success()
} catch (err) {
if (err instanceof TooManyRequestsError) {
error('Too many requests. Try again in 2 minutes.')
// error('Too many requests. Try again in 2 minutes.')
error('太多請求,兩分鐘後再試一次。')
return
}
if (err instanceof ValidationError) {