Skip to content

Commit c4fa21f

Browse files
committed
feat (72h event): block claim button before specific time
1 parent b41a857 commit c4fa21f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/localServer/workers/utilities/web3Util.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,23 @@ const listenProfileVer = async () => {
10151015
selectLeaderboard(epoch)
10161016
}
10171017

1018+
function isSpecificTime() {
1019+
const targetDate = new Date("2024-12-20T00:00:00-08:00"); // PST is UTC-8
1020+
const currentDate = new Date();
1021+
1022+
const targetDatePST = new Date(
1023+
targetDate.toLocaleString("en-US", { timeZone: "America/Los_Angeles" })
1024+
);
1025+
1026+
// Convert current date to PST
1027+
const currentDatePST = new Date(
1028+
currentDate.toLocaleString("en-US", { timeZone: "America/Los_Angeles" })
1029+
);
1030+
1031+
return targetDatePST.getTime() <= currentDatePST.getTime();
1032+
}
1033+
1034+
10181035
const getClaimedCntpReward = async () => {
10191036
const provider = new ethers.JsonRpcProvider(conet_rpc);
10201037

@@ -1033,6 +1050,8 @@ const getClaimedCntpReward = async () => {
10331050
}
10341051

10351052
const getProfileAvailableCntpReward = async (cmd) => {
1053+
if (!isSpecificTime()) return;
1054+
10361055
const walletAddress = cmd.data[0];
10371056

10381057
if (!CoNET_Data || !walletAddress) {
@@ -1060,6 +1079,8 @@ const getProfileAvailableCntpReward = async (cmd) => {
10601079
}
10611080

10621081
const claimChristmasReward = async (cmd: any) => {
1082+
if (!isSpecificTime()) return;
1083+
10631084
const walletAddressTmp = cmd.data[0];
10641085
const walletAddress = ethers.getAddress(walletAddressTmp);
10651086

0 commit comments

Comments
 (0)