mirror of https://gitee.com/answerdev/answer.git
fix: page refresh problem #297
This commit is contained in:
parent
7b55f28993
commit
adbb57816a
|
@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
|
|||
|
||||
import { usePageTags } from '@/hooks';
|
||||
import { loggedUserInfoStore, siteInfoStore } from '@/stores';
|
||||
import { changeEmailVerify, getLoggedUserInfo } from '@/services';
|
||||
import { changeEmailVerify } from '@/services';
|
||||
|
||||
const Index: FC = () => {
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'account_result' });
|
||||
|
@ -20,12 +20,12 @@ const Index: FC = () => {
|
|||
if (code) {
|
||||
// do
|
||||
changeEmailVerify({ code })
|
||||
.then(() => {
|
||||
.then((res) => {
|
||||
setStep('success');
|
||||
getLoggedUserInfo().then((res) => {
|
||||
if (res?.access_token) {
|
||||
// update user info
|
||||
updateUser(res);
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
setStep('invalid');
|
||||
|
|
|
@ -32,7 +32,7 @@ const initUser: UserInfoRes = {
|
|||
const loggedUserInfoStore = create<UserInfoStore>((set) => ({
|
||||
user: initUser,
|
||||
update: (params) => {
|
||||
if (!params.language) {
|
||||
if (!params?.language) {
|
||||
params.language = 'Default';
|
||||
}
|
||||
set(() => {
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noImplicitAny": false,
|
||||
"ignoreDeprecations": "5.0",
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
|
Loading…
Reference in New Issue