Skip to content

Commit

Permalink
buck2: explain: fix replacement string
Browse files Browse the repository at this point in the history
Reviewed By: JakobDegen

Differential Revision: D57189846

fbshipit-source-id: b1171b774f0f3be69f966b5b7b6f46a4e6e297e0
  • Loading branch information
iguridi authored and facebook-github-bot committed May 10, 2024
1 parent a279e83 commit fc89685
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/buck2_explain/js/src/App.tsx
Expand Up @@ -114,11 +114,15 @@ function App() {
*/
useEffect(() => {
const fetchData = async () => {
// keep this line as is, it will be replaced later
let blobBase64 = 'XXDATAXX'
try {
// keep this line as is, it will be replaced later
const data = (await import('./data')).DATA
const blobBase64 = data
const decodedString = atob(blobBase64)
blobBase64 = (await import('./data')).DATA
} catch (error) {
console.info("./data.ts not found, using replaced data")
}

const decodedString = atob(blobBase64)
// TODO iguridi: decode blob better
const byteArray = new Uint8Array(decodedString.length)
for (let i = 0; i < decodedString.length; i++) {
Expand Down Expand Up @@ -148,9 +152,6 @@ function App() {

// This should run just once total
fromUrl(data2, currentTarget, setCurrentTarget)
} catch (error) {
console.error('Error:', error)
}
}
fetchData()
}, [])
Expand Down

0 comments on commit fc89685

Please sign in to comment.