A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: page refresh problem #297
shuaiadbb57816a8c
diff --git a/ui/src/pages/Users/ConfirmNewEmail/index.tsx b/ui/src/pages/Users/ConfirmNewEmail/index.tsxindex 16d09c9c..c99620db 100644--- a/ui/src/pages/Users/ConfirmNewEmail/index.tsx+++ b/ui/src/pages/Users/ConfirmNewEmail/index.tsx@@ -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) {// dochangeEmailVerify({ code })- .then(() => {+ .then((res) => {setStep('success');- getLoggedUserInfo().then((res) => {+ if (res?.access_token) {// update user infoupdateUser(res);- });+ }}).catch(() => {setStep('invalid');diff --git a/ui/src/stores/userInfo.ts b/ui/src/stores/userInfo.tsindex 52976253..14511b0c 100644--- a/ui/src/stores/userInfo.ts+++ b/ui/src/stores/userInfo.ts@@ -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(() => {diff --git a/ui/tsconfig.json b/ui/tsconfig.jsonindex c6e49931..b16f340c 100644--- a/ui/tsconfig.json+++ b/ui/tsconfig.json@@ -14,6 +14,7 @@"resolveJsonModule": true,"isolatedModules": true,"noImplicitAny": false,+ "ignoreDeprecations": "5.0","suppressImplicitAnyIndexErrors": true,"noEmit": true,"jsx": "react-jsx",