I'm kinda new here. Started speedrun ethereum.
I finished the code for quest 2, but timeleft() is not displaying at the front end. It just shows "0" everytime, even redeploying and changing the deadline time.
If i can make this question better, please tell me. Also english is not my first language.
Code snippets:
function timeLeft() public view returns(uint256){
if (block.timestamp >= deadline){
return 0;
} else{
uint timeleft = block.timestamp - deadline;
return timeleft;
}
<p className="m-0 p-0">{timeLeft ? `${humanizeDuration(Number(timeLeft) * 1000)}` : 0}</p>
inputs: [],
name: "timeLeft",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},