You've already forked Nano-Banana-AI-Image-Editor
新增 历史记录搜索、筛选功能;
新增 历史记录悬浮大图功能; 优化 现在历史记录最多可以存储1000条; 优化 历史记录的存储形式改为了使用IndexedDB;
This commit is contained in:
16
src/App.tsx
16
src/App.tsx
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { cn } from './utils/cn';
|
||||
import { Header } from './components/Header';
|
||||
@@ -8,6 +8,7 @@ import { HistoryPanel } from './components/HistoryPanel';
|
||||
import { useKeyboardShortcuts } from './hooks/useKeyboardShortcuts';
|
||||
import { useAppStore } from './store/useAppStore';
|
||||
import { ToastProvider } from './components/ToastContext';
|
||||
import * as indexedDBService from './services/indexedDBService';
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
@@ -23,6 +24,19 @@ function AppContent() {
|
||||
|
||||
const { showPromptPanel, setShowPromptPanel, showHistory, setShowHistory } = useAppStore();
|
||||
|
||||
// 在挂载时初始化IndexedDB
|
||||
useEffect(() => {
|
||||
const init = async () => {
|
||||
try {
|
||||
await indexedDBService.initDB();
|
||||
} catch (err) {
|
||||
console.error('初始化IndexedDB失败:', err);
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
}, []);
|
||||
|
||||
// 在挂载时设置移动设备默认值
|
||||
React.useEffect(() => {
|
||||
const checkMobile = () => {
|
||||
|
||||
Reference in New Issue
Block a user