fix(footer): show version reactively via useAtom

This commit is contained in:
jialin
2026-07-07 20:37:39 +08:00
committed by jialin
parent 90cc6ec753
commit e75beb7324
2 changed files with 3 additions and 4 deletions
+3 -2
View File
@@ -1,10 +1,10 @@
import { GPUStackVersionAtom } from '@/atoms/user';
import { getAtomStorage } from '@/atoms/utils';
import VersionInfo, { modalConfig } from '@/components/version-info';
import externalLinks from '@/constants/external-links';
import { useIntl } from '@umijs/max';
import { Button, Divider, Modal, Typography } from 'antd';
import { createStyles } from 'antd-style';
import { useAtom } from 'jotai';
import styled from 'styled-components';
const CompanyWrapper = styled.div`
@@ -35,6 +35,7 @@ const Footer: React.FC = () => {
const intl = useIntl();
const [modal, contextHolder] = Modal.useModal();
const { styles } = useStyles();
const [version] = useAtom(GPUStackVersionAtom);
const showVersion = () => {
modal.info({
@@ -73,7 +74,7 @@ const Footer: React.FC = () => {
</Button>
<Divider orientation="vertical" />
<Button type="link" size="small" onClick={showVersion}>
{getAtomStorage(GPUStackVersionAtom)?.version}
{version?.version}
</Button>
</div>
</div>
-2
View File
@@ -131,8 +131,6 @@ const Login = () => {
[shouldUseCustomLogin, userSettings]
);
console.log('useCustomLogin', useCustomLogin, userSettings);
const gotoDefaultPage = async (info: any) => {
if (!info || info?.require_password_change) {
return;