Skip to content

Commit ffe2995

Browse files
authored
fix: crate commit hash parse bug (risc0#1662)
1 parent 133b8ce commit ffe2995

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ghpages/dev/crate-validation/index.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,16 @@
7272

7373
async function findMostRecentHash() {
7474
return await fetch("results/index.json")
75-
.then(res => res.json())
75+
.then(res => res.text())
7676
.then(data => {
7777
// Find the most recent timestamp
78-
let mostRecent = data.reduce((prev, current) => (prev.timestamp > current.timestamp) ? prev : current);
78+
const mostRecent = JSON.parse(data.replace("[,", "[")).reduce((prev, current) =>
79+
prev.timestamp > current.timestamp ? prev : current,
80+
);
81+
7982
// Retrieve the hash related to the most recent timestamp
8083
let mostRecentHash = mostRecent.hash;
84+
8185
return mostRecentHash;
8286
})
8387
.catch(err => { console.error(err) });

0 commit comments

Comments
 (0)