mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-12-26 08:58:54 +01:00
fix undefined bug
This commit is contained in:
parent
7f3279f20f
commit
fcf5c41709
@ -25,6 +25,12 @@ export default function CompletedImages({
|
|||||||
<div className={completedImagesMain}>
|
<div className={completedImagesMain}>
|
||||||
{images &&
|
{images &&
|
||||||
images.map((image, index) => {
|
images.map((image, index) => {
|
||||||
|
|
||||||
|
if (void 0 === image) {
|
||||||
|
console.warn(`image ${index} is undefined`);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
key={index}
|
key={index}
|
||||||
|
@ -97,8 +97,11 @@ export default function DisplayPanel() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.flat()
|
.flat()
|
||||||
.reverse();
|
.reverse()
|
||||||
|
.filter((item) => void 0 !== item); // remove undefined items
|
||||||
|
|
||||||
setCompletedImages(temp);
|
setCompletedImages(temp);
|
||||||
|
debugger;
|
||||||
setCurrentImage(temp[0] || null);
|
setCurrentImage(temp[0] || null);
|
||||||
} else {
|
} else {
|
||||||
setCompletedImages([]);
|
setCompletedImages([]);
|
||||||
@ -113,6 +116,7 @@ export default function DisplayPanel() {
|
|||||||
<CurrentDisplay image={currentImage}></CurrentDisplay>
|
<CurrentDisplay image={currentImage}></CurrentDisplay>
|
||||||
</div>
|
</div>
|
||||||
<div className={previousImages}>
|
<div className={previousImages}>
|
||||||
|
|
||||||
<CompletedImages
|
<CompletedImages
|
||||||
images={completedImages}
|
images={completedImages}
|
||||||
setCurrentDisplay={setCurrentImage}
|
setCurrentDisplay={setCurrentImage}
|
||||||
|
2
ui/frontend/dist/index.js
vendored
2
ui/frontend/dist/index.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user