mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix uploads not loading more images correctly after generation
This commit is contained in:
parent
7b0938e7e4
commit
96b4d35d43
@ -1,4 +1,8 @@
|
||||
import { createEntityAdapter, createSlice } from '@reduxjs/toolkit';
|
||||
import {
|
||||
PayloadAction,
|
||||
createEntityAdapter,
|
||||
createSlice,
|
||||
} from '@reduxjs/toolkit';
|
||||
|
||||
import { RootState } from 'app/store/store';
|
||||
import {
|
||||
@ -22,6 +26,7 @@ type AdditionalUploadsState = {
|
||||
pages: number;
|
||||
isLoading: boolean;
|
||||
nextPage: number;
|
||||
upsertedImageCount: number;
|
||||
};
|
||||
|
||||
export const initialUploadsState =
|
||||
@ -30,6 +35,7 @@ export const initialUploadsState =
|
||||
pages: 0,
|
||||
nextPage: 0,
|
||||
isLoading: false,
|
||||
upsertedImageCount: 0,
|
||||
});
|
||||
|
||||
export type UploadsState = typeof initialUploadsState;
|
||||
@ -38,7 +44,10 @@ const uploadsSlice = createSlice({
|
||||
name: 'uploads',
|
||||
initialState: initialUploadsState,
|
||||
reducers: {
|
||||
uploadUpserted: uploadsAdapter.upsertOne,
|
||||
uploadUpserted: (state, action: PayloadAction<UploadsImageDTO>) => {
|
||||
uploadsAdapter.upsertOne(state, action.payload);
|
||||
state.upsertedImageCount += 1;
|
||||
},
|
||||
},
|
||||
extraReducers: (builder) => {
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user