GraphemeNFT / rarible-scaffold

MIT License
0 stars 0 forks source link

canvas blob for WORD #64

Closed dcsan closed 2 years ago

dcsan commented 2 years ago
Unhandled Rejection (TypeError): Cannot read property 'toBlob' of null
canBlob
src/components/DrawWordTool.jsx:147
  144 | const castWord = async () => {
  145 |   let canvas = document.getElementById('drawword-canvas');
  146 |   const canBlob = await new Promise((resolve, reject) => {
> 147 |     canvas.toBlob((blob) => resolve(blob));
      | ^  148 |   });
  149 |   let ipfsCanvasResult;
  150 |   try {
View compiled
castWord
dcsan commented 2 years ago

fixed

tomosaigon commented 2 years ago

castWord ipfsResult:

cid: QmRp2t5VZJEZkG4bMEvzcN3wuuy8dZqQ6BkxZGUhZVkACq

{"description":"A Grapheme NFT Word","external_url":"https://austingriffith.com/portfolio/paintings/","image":"ipfs://QmP5LQvuVvBpSNJpmniaohCMk8rHW7gKQxHwLS9cU6yG6E","name":"LLM","attributes":[{"trait_type":"tokenId_0","value":16},{"trait_type":"row_0","value":1},{"trait_type":"col_0","value":1},{"trait_type":"tokenId_1","value":17},{"trait_type":"row_1","value":1},{"trait_type":"col_1","value":21},{"trait_type":"tokenId_2","value":15},{"trait_type":"row_2","value":1},{"trait_type":"col_2","value":41},{"trait_type":"tokenId_3","value":13},{"trait_type":"row_3","value":1},{"trait_type":"col_3","value":61}]}

https://cloudflare-ipfs.com/ipfs/QmP5LQvuVvBpSNJpmniaohCMk8rHW7gKQxHwLS9cU6yG6E image

This works.