truffle-box / react-auth-box

Truffle, Webpack, React, Redux boilerplate with routing and authentication via a smart contract.
https://truffle-box.github.io/
MIT License
176 stars 66 forks source link

web3.toUtf8 is not a function #35

Open kenzo0202 opened 6 years ago

kenzo0202 commented 6 years ago

I got error "TypeError: web3.toUtf8 is not a function" in LoginButtonActions.js. Maybe, web3.js(ver1.0.0) made toUtf8() method deprecated.(https://web3js.readthedocs.io/en/1.0/web3-utils.html?highlight=toutf8#hextoutf8) So I fixed this problem like below. I wish you change source code.

var userName = web3.toUtf8(result)

var userName = web3.utils.hexToUtf8(result)

ZainaliSyed commented 5 years ago

Thank you it's working you need to console WEB3 let web3 = store.getState().web3.web3Instance; console.log("loginUser : ", web3);