🔖chore: Remove useless codes in Footer.js

This commit is contained in:
Apple\Apple
2025-05-18 22:58:21 +08:00
parent 7739219ca6
commit 59b1e970fd

View File

@@ -1,15 +1,10 @@
import React, { useEffect, useState, useContext } from 'react'; import React, { useEffect, useState, useMemo } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { getFooterHTML, getSystemName } from '../helpers'; import { getFooterHTML } from '../helpers';
import { Layout, Tooltip } from '@douyinfe/semi-ui';
import { StyleContext } from '../context/Style/index.js';
const FooterBar = () => { const FooterBar = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const systemName = getSystemName();
const [footer, setFooter] = useState(getFooterHTML()); const [footer, setFooter] = useState(getFooterHTML());
const [styleState] = useContext(StyleContext);
let remainCheckTimes = 5;
const loadFooter = () => { const loadFooter = () => {
let footer_html = localStorage.getItem('footer_html'); let footer_html = localStorage.getItem('footer_html');
@@ -18,7 +13,7 @@ const FooterBar = () => {
} }
}; };
const defaultFooter = ( const defaultFooter = useMemo(() => (
<div className='custom-footer'> <div className='custom-footer'>
<a <a
href='https://github.com/Calcium-Ion/new-api' href='https://github.com/Calcium-Ion/new-api'
@@ -40,18 +35,10 @@ const FooterBar = () => {
One API One API
</a> </a>
</div> </div>
); ), [t]);
useEffect(() => { useEffect(() => {
const timer = setInterval(() => { loadFooter();
if (remainCheckTimes <= 0) {
clearInterval(timer);
return;
}
remainCheckTimes--;
loadFooter();
}, 200);
return () => clearTimeout(timer);
}, []); }, []);
return ( return (