Remove spurious error on saving edited file in desktop

This commit is contained in:
Manav Rathi
2025-02-26 12:54:31 +05:30
parent d0f30a1198
commit a157273b42

View File

@@ -844,8 +844,15 @@ const markUploaded = async (electron: Electron, item: ClusteredUploadItem) => {
} else if (p && typeof p == "object" && "path" in p) {
electron.markUploadedFiles([p.path]);
} else {
throw new Error(
"Attempting to mark upload completion of unexpected desktop upload items",
// We can come here when the user saves an image they've edited, in
// which case `item` will be a web File object which won't have a
// path. Such a la carte uploads don't mark the file as pending
// anyways, so there isn't anything to do also.
//
// Keeping a log here, though really the upper layers of the code
// need to be reworked so that we don't even get here in such cases.
log.info(
"Ignoring attempt to mark upload completion of (likely edited) item",
);
}
}