fix(footer): show version reactively via useAtom
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user