Skip to content

Commit 75f8f81

Browse files
committed
fix: 修复TypeScript编译错误
- 移除未使用的导入和变量 - 确保生产环境构建成功 - 优化代码质量
1 parent 1d954e8 commit 75f8f81

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

src/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react';
21
import { ThemeProvider, createTheme } from '@mui/material/styles';
3-
import { Box, Typography, Alert } from '@mui/material';
2+
import { Typography, Alert } from '@mui/material';
43
import CssBaseline from '@mui/material/CssBaseline';
54
import { AppProvider } from './context/AppContext';
65
import MainLayout from './components/MainLayout';

src/components/AdvancedSettings.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
InputLabel,
1616
TextField,
1717
Box,
18-
Divider,
1918
Accordion,
2019
AccordionSummary,
2120
AccordionDetails,
@@ -24,8 +23,7 @@ import {
2423
} from '@mui/material';
2524
import {
2625
ExpandMore as ExpandMoreIcon,
27-
Add as AddIcon,
28-
Delete as DeleteIcon
26+
Add as AddIcon
2927
} from '@mui/icons-material';
3028
import { useApp } from '../context/AppContext';
3129

@@ -69,8 +67,6 @@ const AdvancedSettings: React.FC<AdvancedSettingsProps> = ({ open, onClose }) =>
6967
}
7068
};
7169

72-
const allDomains = [...state.savedDomains.preset, ...state.savedDomains.custom];
73-
7470
return (
7571
<Dialog open={open} onClose={onClose} maxWidth="sm" fullWidth>
7672
<DialogTitle>高级设置</DialogTitle>

src/components/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React from 'react';
22
import {
33
AppBar,
44
Toolbar,

src/components/UsedEmailsPage.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
} from '@mui/material';
3030
import {
3131
Delete as DeleteIcon,
32-
Search as SearchIcon,
3332
Clear as ClearIcon,
3433
ContentCopy as CopyIcon,
3534
FilterList as FilterIcon
@@ -47,7 +46,6 @@ interface UsedEmailsPageProps {
4746
const UsedEmailsPage: React.FC<UsedEmailsPageProps> = ({ onShowMessage }) => {
4847
const [emails, setEmails] = useState<UsedEmail[]>([]);
4948
const [total, setTotal] = useState(0);
50-
const [loading, setLoading] = useState(false);
5149
const [page, setPage] = useState(0);
5250
const [pageSize, setPageSize] = useState(() => {
5351
return Number(localStorage.getItem('emailPageSize')) || 10;
@@ -75,7 +73,6 @@ const UsedEmailsPage: React.FC<UsedEmailsPageProps> = ({ onShowMessage }) => {
7573

7674
// 加载数据
7775
const loadEmails = async () => {
78-
setLoading(true);
7976
try {
8077
const result = await emailDB.getUsedEmails({
8178
search,
@@ -92,8 +89,6 @@ const UsedEmailsPage: React.FC<UsedEmailsPageProps> = ({ onShowMessage }) => {
9289
setTotal(result.total);
9390
} catch (error) {
9491
onShowMessage('加载数据失败', 'error');
95-
} finally {
96-
setLoading(false);
9792
}
9893
};
9994

src/context/AppContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { createContext, useContext, useReducer, ReactNode, useEffect } from 'react';
2-
import { AppState, Action, GenerationConfig, GeneratedProfile } from '../types';
2+
import { AppState, Action, GenerationConfig } from '../types';
33
import { PRESET_DOMAINS, generateProfile, generateUsername, generateEmail, generatePassword, generateName } from '../utils/generators';
44
import { emailDB } from '../utils/indexedDB';
55
import { settingsDB } from '../utils/settingsDB';

0 commit comments

Comments
 (0)