fix(ui): restore removed type

This commit is contained in:
Mary Hipp 2023-04-03 14:48:20 -04:00
parent e2114a1da5
commit ed00afc64d
3 changed files with 16 additions and 3 deletions

View File

@ -124,6 +124,20 @@ export declare type Image = {
category: GalleryCategory;
isBase64?: boolean;
dreamPrompt?: 'string';
name?: string;
};
/**
* ResultImage
*/
export declare type ResultImage = {
name: string;
url: string;
thumbnail: string;
width: number;
height: number;
timestamp: number;
metadata?: Metadata;
};
// GalleryImages is an array of Image.

View File

@ -1,11 +1,8 @@
import type { PayloadAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { v4 as uuidv4 } from 'uuid';
import { ProgressImage } from './events/types';
import { createSession, invokeSession } from 'services/thunks/session';
import { getImage, uploadImage } from './thunks/image';
import * as InvokeAI from 'app/invokeai';
import { addImage } from 'features/gallery/store/gallerySlice';
/**
* Just temp until we work out better statuses

View File

@ -35,6 +35,7 @@ export const invokeMiddleware: Middleware =
const uploadLocation = action.payload;
console.log('uploadImage.fulfilled');
// TODO: actually get correct attributes here
const newImage: InvokeAI.Image = {
uuid: uuidv4(),
category: 'user',
@ -49,6 +50,7 @@ export const invokeMiddleware: Middleware =
const { activeTab } = getState().ui;
const activeTabName = tabMap[activeTab];
if (activeTabName === 'unifiedCanvas') {
dispatch(setInitialCanvasImage(newImage));
} else if (activeTabName === 'img2img') {