Skip to content

Commit 0e49e65

Browse files
authored
Merge pull request #54 from KNowledgeOnWebScale/EDC_active
data upload error fixed
2 parents 9f0c010 + bbe8ebe commit 0e49e65

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/fileUpload.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,16 @@ export async function alreadyExists(
276276
// const containerContents = await fetchData(uploadUrl);
277277
try {
278278
const containerContents = await getSolidDataset(uploadUrl, { fetch });
279-
const allegedFile = getThing(containerContents, `${uploadUrl}${file.name}`);
280-
return true;
279+
const containedUrls = getContainedResourceUrlAll(containerContents);
280+
281+
// See if it exists in the list
282+
if (containedUrls.includes(uploadUrl + file.name)) {
283+
console.log("Found a match!");
284+
return true;
285+
} else {
286+
console.log("No match found.");
287+
return false;
288+
}
281289
} catch (e) {
282290
// console.log(`${uploadUrl}${file.name} does not yet exist, uploading now.`)
283291
return false;

0 commit comments

Comments
 (0)