-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hardcode timer (TO REVERT) #2425
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,8 +1,9 @@ | ||||||||||
import { configManager } from "@/dojo/setup"; | ||||||||||
import { useEffect, useState } from "react"; | ||||||||||
|
||||||||||
export const useSeasonStart = () => { | ||||||||||
const seasonStart = BigInt(configManager.getSeasonConfig().startAt || 0); | ||||||||||
const seasonStart = BigInt(new Date("2024-12-11T15:35:00Z").getTime() / 1000); | ||||||||||
|
||||||||||
/*BigInt(configManager.getSeasonConfig().startAt || 0);*/ | ||||||||||
const nextBlockTimestamp = BigInt(Math.floor(Date.now() / 1000)); | ||||||||||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Reconsider hardcoding the season start date The change from a configuration-based approach to a hardcoded date raises several concerns:
Consider these alternatives:
- const seasonStart = BigInt(new Date("2024-12-11T15:35:00Z").getTime() / 1000);
-
- /*BigInt(configManager.getSeasonConfig().startAt || 0);*/
+ const seasonStart = BigInt(configManager.getSeasonConfig().startAt || 0); 📝 Committable suggestion
Suggested change
|
||||||||||
|
||||||||||
const [countdown, setCountdown] = useState<bigint>(0n); | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid hardcoding future dates and consider configuration-based approach
Several concerns with the current implementation:
Consider these alternatives:
Example implementation: