mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-09-07 00:27:44 +08:00
refactor(Web): update type casting and remove unused imports
This commit is contained in:
+2
-1
@@ -24,4 +24,5 @@ dist-ssr
|
|||||||
/obj
|
/obj
|
||||||
/Uploads
|
/Uploads
|
||||||
/appsettings.Development.json
|
/appsettings.Development.json
|
||||||
/Foxel.sln.DotSettings.user
|
/Foxel.sln.DotSettings.user
|
||||||
|
/Folder.DotSettings.user
|
||||||
@@ -41,7 +41,7 @@ const BackgroundTasks: React.FC = () => {
|
|||||||
// 设置轮询
|
// 设置轮询
|
||||||
if (pollingActive) {
|
if (pollingActive) {
|
||||||
const interval = setInterval(fetchTasks, 3000);
|
const interval = setInterval(fetchTasks, 3000);
|
||||||
setPollingIntervalState(interval);
|
setPollingIntervalState(interval as unknown as number);
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
@@ -66,7 +66,7 @@ const BackgroundTasks: React.FC = () => {
|
|||||||
} else if (hasActiveTasks && !pollingActive) {
|
} else if (hasActiveTasks && !pollingActive) {
|
||||||
setPollingActive(true);
|
setPollingActive(true);
|
||||||
const interval = setInterval(fetchTasks, 3000);
|
const interval = setInterval(fetchTasks, 3000);
|
||||||
setPollingIntervalState(interval);
|
setPollingIntervalState(interval as unknown as number);
|
||||||
}
|
}
|
||||||
}, [tasks, pollingActive, pollingInterval, fetchTasks]);
|
}, [tasks, pollingActive, pollingInterval, fetchTasks]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import { Tabs, Layout, Menu, Space } from 'antd';
|
import { Tabs, Layout, Menu, Space } from 'antd';
|
||||||
import { useAuth } from '../../auth/AuthContext.tsx';
|
import { useAuth } from '../../auth/AuthContext.tsx';
|
||||||
import { UserRole } from '../../api/types';
|
|
||||||
import { useState, type SetStateAction } from 'react';
|
import { useState, type SetStateAction } from 'react';
|
||||||
import UserProfile from './UserProfile.tsx';
|
import UserProfile from './UserProfile.tsx';
|
||||||
import useIsMobile from '../../hooks/useIsMobile';
|
import useIsMobile from '../../hooks/useIsMobile';
|
||||||
import {
|
import {
|
||||||
UserOutlined,
|
UserOutlined,
|
||||||
SettingOutlined,
|
|
||||||
BgColorsOutlined,
|
BgColorsOutlined,
|
||||||
BellOutlined,
|
BellOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
@@ -15,7 +13,7 @@ const { TabPane } = Tabs;
|
|||||||
const { Sider, Content } = Layout;
|
const { Sider, Content } = Layout;
|
||||||
|
|
||||||
function Settings() {
|
function Settings() {
|
||||||
const { hasRole } = useAuth();
|
useAuth();
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const [activeMenu, setActiveMenu] = useState('profile');
|
const [activeMenu, setActiveMenu] = useState('profile');
|
||||||
const [activeTab, setActiveTab] = useState('basic');
|
const [activeTab, setActiveTab] = useState('basic');
|
||||||
|
|||||||
Reference in New Issue
Block a user