mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-12-25 16:38:55 +01:00
fix shift
This commit is contained in:
parent
8155e3ef7a
commit
1c1cf58409
@ -228,12 +228,11 @@ export default function DisplayPanel() {
|
||||
null
|
||||
);
|
||||
|
||||
const len = useImageDisplay((state) => state.len);
|
||||
const getCurrentImage = useImageDisplay((state) => state.getCurrentImage);
|
||||
const images = useImageDisplay((state) => state.images);
|
||||
|
||||
useEffect(() => {
|
||||
if (len > 0) {
|
||||
if (images.length > 0) {
|
||||
debugger;
|
||||
const cur = getCurrentImage();
|
||||
console.log("cur", cur);
|
||||
@ -241,7 +240,7 @@ export default function DisplayPanel() {
|
||||
} else {
|
||||
setCurrentImage(null);
|
||||
}
|
||||
}, [len, getCurrentImage]);
|
||||
}, [images, getCurrentImage]);
|
||||
|
||||
// useEffect(() => {
|
||||
// console.log("images CHANGED");
|
||||
|
@ -15,7 +15,6 @@ interface ImageDisplayState {
|
||||
export const useImageDisplay = create<ImageDisplayState>((set, get) => ({
|
||||
// imageOptions: new Map<string, any>(),
|
||||
images: [],
|
||||
len: 0,
|
||||
// currentImage: null,
|
||||
// use produce to make sure we don't mutate state
|
||||
// imageOptions: any
|
||||
@ -25,9 +24,7 @@ export const useImageDisplay = create<ImageDisplayState>((set, get) => ({
|
||||
// options: imageOptions
|
||||
// state.currentImage = { display: ImageData, imageOptions };
|
||||
// imageOptions
|
||||
state.images.push({ data: ImageData, info: imageOptions });
|
||||
state.len += 1;
|
||||
debugger
|
||||
state.images.unshift({ data: ImageData, info: imageOptions });
|
||||
})
|
||||
);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user