Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 committed Aug 6, 2024
1 parent f812cf0 commit c2bf2e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions frontend/desktop/src/components/account/RealNameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import { useQuery } from '@tanstack/react-query';
import { useTimer } from '@/hooks/useTimer';
import { SmsType } from '@/services/backend/db/verifyCode';

export function useRealAuthNotification(props?: UseToastOptions) {
const realAuthNotification = useToast({
export function useRealNameAuthNotification(props?: UseToastOptions) {
const realNameAuthNotification = useToast({
position: 'top',
...props,
render: (props) => {
Expand Down Expand Up @@ -100,7 +100,7 @@ export function useRealAuthNotification(props?: UseToastOptions) {
}
});
return {
realAuthNotification
realNameAuthNotification
};
}

Expand Down
12 changes: 6 additions & 6 deletions frontend/desktop/src/components/desktop_content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Monitor from './monitor';
import SearchBox from './searchBox';
import Warn from './warn';
import NeedToMerge from '../account/AccountCenter/mergeUser/NeedToMergeModal';
import { useRealAuthNotification } from '../account/RealNameModal';
import { useRealNameAuthNotification } from '../account/RealNameModal';
import useSessionStore from '@/stores/session';
import { useQuery } from '@tanstack/react-query';
import { UserInfo } from '@/api/auth';
Expand All @@ -45,12 +45,12 @@ export default function Desktop(props: any) {
const { installedApps: apps, runningInfo, openApp, setToHighestLayerById } = useAppStore();
const backgroundImage = useConfigStore().layoutConfig?.backgroundImage;
const { message } = useMessage();
const { realAuthNotification } = useRealAuthNotification();
const { realNameAuthNotification } = useRealNameAuthNotification();
const [showAccount, setShowAccount] = useState(false);
const { layoutConfig } = useConfigStore();
const { session } = useSessionStore();
const { commonConfig } = useConfigStore();
const realAuthNotificationIdRef = useRef<string | number | undefined>();
const realNameAuthNotificationIdRef = useRef<string | number | undefined>();

const infoData = useQuery({
queryFn: UserInfo,
Expand Down Expand Up @@ -117,7 +117,7 @@ export default function Desktop(props: any) {

useEffect(() => {
if (infoData.isSuccess && !infoData?.data?.realName && commonConfig?.realNameAuthEnabled) {
realAuthNotificationIdRef.current = realAuthNotification({
realNameAuthNotificationIdRef.current = realNameAuthNotification({
title: '国内可用区需要实名认证,未实名认证将会被限制使用,点击进行实名',
status: 'error',
duration: null,
Expand All @@ -126,8 +126,8 @@ export default function Desktop(props: any) {
}

return () => {
if (realAuthNotificationIdRef.current) {
realAuthNotification.close(realAuthNotificationIdRef.current);
if (realNameAuthNotificationIdRef.current) {
realNameAuthNotification.close(realNameAuthNotificationIdRef.current);
}
};
}, [infoData.data, commonConfig?.realNameAuthEnabled]);
Expand Down

0 comments on commit c2bf2e9

Please sign in to comment.