Skip to content

Commit 2f918dd

Browse files
committed
chore: add comments to internal data extraction function for clarity
1 parent 25606e9 commit 2f918dd

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/pages/DatasetDetailPage.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const DatasetDetailPage: React.FC = () => {
225225
internalLinks.push({
226226
name: `JMesh`,
227227
data: obj,
228-
index: internalLinks.length,
228+
index: internalLinks.length, // maybe can be remove
229229
arraySize: obj.MeshNode._ArraySize_,
230230
});
231231
}
@@ -237,7 +237,7 @@ const DatasetDetailPage: React.FC = () => {
237237
internalLinks.push({
238238
name: `JNIfTI`,
239239
data: obj,
240-
index: internalLinks.length,
240+
index: internalLinks.length, //maybe can be remove
241241
arraySize: obj.NIFTIData._ArraySize_,
242242
});
243243
}
@@ -252,7 +252,7 @@ const DatasetDetailPage: React.FC = () => {
252252
internalLinks.push({
253253
name: `JData`,
254254
data: obj,
255-
index: internalLinks.length,
255+
index: internalLinks.length, // maybe can be remove
256256
arraySize: obj._ArraySize_,
257257
});
258258
}
@@ -287,6 +287,8 @@ const DatasetDetailPage: React.FC = () => {
287287
const fetchData = async () => {
288288
if (dbName && docId) {
289289
await dispatch(fetchDocumentDetails({ dbName, docId }));
290+
// console.log("dbName", dbName);
291+
// console.log("docId", docId);
290292
}
291293
};
292294

@@ -296,6 +298,7 @@ const DatasetDetailPage: React.FC = () => {
296298
useEffect(() => {
297299
if (datasetDocument) {
298300
// ✅ Extract External Data & Assign `index`
301+
console.log("datasetDocument", datasetDocument);
299302
const links = extractDataLinks(datasetDocument, "").map(
300303
(link, index) => ({
301304
...link,
@@ -337,12 +340,17 @@ const DatasetDetailPage: React.FC = () => {
337340
}
338341
});
339342

340-
setTotalFileSize(totalSize);
343+
// setTotalFileSize(totalSize);
341344

342-
const minifiedBlob = new Blob([JSON.stringify(datasetDocument)], {
345+
// const minifiedBlob = new Blob([JSON.stringify(datasetDocument)], {
346+
// type: "application/json",
347+
// });
348+
// setJsonSize(minifiedBlob.size);
349+
350+
const blob = new Blob([JSON.stringify(datasetDocument, null, 2)], {
343351
type: "application/json",
344352
});
345-
setJsonSize(minifiedBlob.size);
353+
setJsonSize(blob.size);
346354

347355
// // ✅ Construct download script dynamically
348356
let script = `curl -L --create-dirs "https://neurojson.io:7777/${dbName}/${docId}" -o "${docId}.json"\n`;

0 commit comments

Comments
 (0)