新增 历史记录持久化功能;

新增 增加最大历史记录条数为10条;
This commit is contained in:
2025-09-14 07:14:16 +08:00
parent 92a78abd63
commit f2f9e4a239
3 changed files with 525 additions and 230 deletions

View File

@@ -6,7 +6,7 @@ import { Generation, Edit, Asset } from '../types';
import { useToast } from '../components/ToastContext';
export const useImageGeneration = () => {
const { addGeneration, setIsGenerating, setCanvasImage, setCurrentProject, currentProject } = useAppStore();
const { addGeneration, setIsGenerating, setCanvasImage } = useAppStore();
const { addToast } = useToast();
const generateMutation = useMutation({
@@ -81,7 +81,6 @@ export const useImageEditing = () => {
editReferenceImages,
brushStrokes,
selectedGenerationId,
currentProject,
seed,
temperature,
uploadedImages
@@ -229,7 +228,7 @@ export const useImageEditing = () => {
const edit: Edit = {
id: generateId(),
parentGenerationId: selectedGenerationId || (currentProject?.generations[currentProject.generations.length - 1]?.id || ''),
parentGenerationId: selectedGenerationId || '',
maskAssetId: brushStrokes.length > 0 ? generateId() : undefined,
maskReferenceAsset,
instruction,