We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47be61a commit bbe8ebeCopy full SHA for bbe8ebe
1 file changed
src/components/fileUpload.ts
@@ -276,8 +276,16 @@ export async function alreadyExists(
276
// const containerContents = await fetchData(uploadUrl);
277
try {
278
const containerContents = await getSolidDataset(uploadUrl, { fetch });
279
- const allegedFile = getThing(containerContents, `${uploadUrl}${file.name}`);
280
- return true;
+ const containedUrls = getContainedResourceUrlAll(containerContents);
+
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
+ }
289
} catch (e) {
290
// console.log(`${uploadUrl}${file.name} does not yet exist, uploading now.`)
291
return false;
0 commit comments