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