From 95f00b08c092b6a8ac55e7763dcb9dcdc6c661a0 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 10 Nov 2024 14:55:12 +0900 Subject: [PATCH] fix conditions --- .../src/components/MkSignupDialog.form.vue | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/packages/frontend/src/components/MkSignupDialog.form.vue b/packages/frontend/src/components/MkSignupDialog.form.vue index 176ed024e3..eb8c7de4fe 100644 --- a/packages/frontend/src/components/MkSignupDialog.form.vue +++ b/packages/frontend/src/components/MkSignupDialog.form.vue @@ -279,21 +279,23 @@ async function onSubmit(): Promise { }); if (res) { - if (res.status === 204 && instance.emailRequiredForSignup) { - os.alert({ - type: 'success', - title: i18n.ts._signup.almostThere, - text: i18n.tsx._signup.emailSent({ email: email.value }), - }); - emit('signupEmailPending'); - } else if (res.status === 200) { - const resJson = (await res.json()) as Misskey.entities.SignupResponse; - if (_DEV_) console.log(resJson); + if (res.ok) { + if (res.status === 204 || instance.emailRequiredForSignup) { + os.alert({ + type: 'success', + title: i18n.ts._signup.almostThere, + text: i18n.tsx._signup.emailSent({ email: email.value }), + }); + emit('signupEmailPending'); + } else { + const resJson = (await res.json()) as Misskey.entities.SignupResponse; + if (_DEV_) console.log(resJson); - emit('signup', resJson); + emit('signup', resJson); - if (props.autoSet) { - await login(resJson.token); + if (props.autoSet) { + await login(resJson.token); + } } } else { const resJson = (await res.json()) as {