mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): update UI to handle uploads with alternate URLs (#3274)
This commit is contained in:
commit
a3c5a664e5
@ -7,6 +7,7 @@ import { IRect } from 'konva/lib/types';
|
|||||||
import { clamp } from 'lodash';
|
import { clamp } from 'lodash';
|
||||||
import { isImageOutput } from 'services/types/guards';
|
import { isImageOutput } from 'services/types/guards';
|
||||||
import { imageUploaded } from 'services/thunks/image';
|
import { imageUploaded } from 'services/thunks/image';
|
||||||
|
import { deserializeImageResponse } from 'services/util/deserializeImageResponse';
|
||||||
|
|
||||||
export type GalleryCategory = 'user' | 'result';
|
export type GalleryCategory = 'user' | 'result';
|
||||||
|
|
||||||
@ -295,9 +296,10 @@ export const gallerySlice = createSlice({
|
|||||||
* Upload Image - FULFILLED
|
* Upload Image - FULFILLED
|
||||||
*/
|
*/
|
||||||
builder.addCase(imageUploaded.fulfilled, (state, action) => {
|
builder.addCase(imageUploaded.fulfilled, (state, action) => {
|
||||||
const { location } = action.payload;
|
const { response } = action.payload;
|
||||||
const imageName = location.split('/').pop() || '';
|
|
||||||
state.selectedImageName = imageName;
|
const uploadedImage = deserializeImageResponse(response);
|
||||||
|
state.selectedImageName = uploadedImage.name;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user