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