Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/components/fileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,16 @@ export async function alreadyExists(
// const containerContents = await fetchData(uploadUrl);
try {
const containerContents = await getSolidDataset(uploadUrl, { fetch });
const allegedFile = getThing(containerContents, `${uploadUrl}${file.name}`);
return true;
const containedUrls = getContainedResourceUrlAll(containerContents);

// See if it exists in the list
if (containedUrls.includes(uploadUrl + file.name)) {
console.log("Found a match!");
return true;
} else {
console.log("No match found.");
return false;
}
} catch (e) {
// console.log(`${uploadUrl}${file.name} does not yet exist, uploading now.`)
return false;
Expand Down
Loading