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 { RootState } from 'app/store/store';
|
||||||
import {
|
import {
|
||||||
@ -22,6 +26,7 @@ type AdditionalUploadsState = {
|
|||||||
pages: number;
|
pages: number;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
nextPage: number;
|
nextPage: number;
|
||||||
|
upsertedImageCount: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initialUploadsState =
|
export const initialUploadsState =
|
||||||
@ -30,6 +35,7 @@ export const initialUploadsState =
|
|||||||
pages: 0,
|
pages: 0,
|
||||||
nextPage: 0,
|
nextPage: 0,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
upsertedImageCount: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
export type UploadsState = typeof initialUploadsState;
|
export type UploadsState = typeof initialUploadsState;
|
||||||
@ -38,7 +44,10 @@ const uploadsSlice = createSlice({
|
|||||||
name: 'uploads',
|
name: 'uploads',
|
||||||
initialState: initialUploadsState,
|
initialState: initialUploadsState,
|
||||||
reducers: {
|
reducers: {
|
||||||
uploadUpserted: uploadsAdapter.upsertOne,
|
uploadUpserted: (state, action: PayloadAction<UploadsImageDTO>) => {
|
||||||
|
uploadsAdapter.upsertOne(state, action.payload);
|
||||||
|
state.upsertedImageCount += 1;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
extraReducers: (builder) => {
|
extraReducers: (builder) => {
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user