fix conditions
This commit is contained in:
parent
401094b6b2
commit
95f00b08c0
|
@ -279,14 +279,15 @@ async function onSubmit(): Promise<void> {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
if (res.status === 204 && instance.emailRequiredForSignup) {
|
if (res.ok) {
|
||||||
|
if (res.status === 204 || instance.emailRequiredForSignup) {
|
||||||
os.alert({
|
os.alert({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
title: i18n.ts._signup.almostThere,
|
title: i18n.ts._signup.almostThere,
|
||||||
text: i18n.tsx._signup.emailSent({ email: email.value }),
|
text: i18n.tsx._signup.emailSent({ email: email.value }),
|
||||||
});
|
});
|
||||||
emit('signupEmailPending');
|
emit('signupEmailPending');
|
||||||
} else if (res.status === 200) {
|
} else {
|
||||||
const resJson = (await res.json()) as Misskey.entities.SignupResponse;
|
const resJson = (await res.json()) as Misskey.entities.SignupResponse;
|
||||||
if (_DEV_) console.log(resJson);
|
if (_DEV_) console.log(resJson);
|
||||||
|
|
||||||
|
@ -295,6 +296,7 @@ async function onSubmit(): Promise<void> {
|
||||||
if (props.autoSet) {
|
if (props.autoSet) {
|
||||||
await login(resJson.token);
|
await login(resJson.token);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const resJson = (await res.json()) as {
|
const resJson = (await res.json()) as {
|
||||||
error?: {
|
error?: {
|
||||||
|
|
Loading…
Reference in New Issue