w3hc / gov-ui

A UI for Gov
https://gov-ui.netlify.app/
GNU General Public License v3.0
2 stars 2 forks source link

Fix Web3 Storage when not encrypted #33

Closed julienbrg closed 1 year ago

julienbrg commented 1 year ago

The proposal submission process does not work when the attached file is NOT encrypted: the web3.storage part crashes.

julienbrg commented 1 year ago
error (storeFile): TypeError: file.stream is not a function
    at get content [as content] (lib.js:571:31)
    at isFileObject (utils.js:15:54)
    at normaliseCandidateMultiple (normalise-candidate-multiple.js:43:64)
    at async dagBuilder (index.js:39:20)
    at async batch (index.js:20:20)
    at async parallelBatch (index.js:25:20)
    at async treeBuilder (tree-builder.js:63:20)
    at async importer (index.js:33:20)
    at async last (index.js:13:20)
    at async pack (index.js:25:23)
    at async Web3Storage.put (lib.js:165:29)
    at async storeFile (UploadFile.tsx:26:25)
    at async UploadFile (UploadFile.tsx:33:17)
    at async submitProposal (push.tsx:95:38)

push.tsx line 108: fileToAddInDescription: https://null.ipfs.w3s.link/aztec.png

http://localhost:3000/push/