feat: making SSE work on mobiles

This commit is contained in:
2025-05-12 20:11:58 +01:00
parent 636bd9df0e
commit 076e230a01
2 changed files with 13 additions and 25 deletions

View File

@@ -54,27 +54,14 @@ export const Notifications = (onCompleteImage: () => void) => {
return;
}
console.log("SSE: ", processingImage);
const { ImageID, Status } = processingImage.output;
if (state.ProcessingImages[ImageID] != null) {
const localImageStatus = state.ProcessingImages[ImageID];
if (localImageStatus !== "in-progress" || Status !== "complete") {
console.error(
"Invalid state, an image present must always be in process",
);
return;
}
if (Status === "complete") {
setState("ProcessingImages", ImageID, undefined);
onCompleteImage();
} else {
if (Status !== "in-progress") {
console.error(
"Invalid state, at this point a new image that isn't present should be in-progress",
);
return;
}
setState("ProcessingImages", ImageID, Status);
}
};