Skip to content

Commit

Permalink
Merge branch 'main' into deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ThEditor committed Sep 17, 2024
2 parents 254c71c + 0b3b7a5 commit a7ef3a5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ interface LeaderboardData {
tpoints: number;
}

const explicitForce = false;

const LeaderboardPage: React.FC = () => {
const [searchQuery, setSearchQuery] = useState<string>("");
const [leaderboardData, setLeaderboardData] = useState<LeaderboardData[]>([]);
Expand All @@ -42,6 +44,26 @@ const LeaderboardPage: React.FC = () => {
const fetchLeaderboardData = async () => {
try {
setLoading(true);

const urlParams = new URLSearchParams(window.location.search);
const force = urlParams.get("force");
if (explicitForce && force !== "true") {
setLeaderboardData([{
name: "YOU",
tpoints: 404
}, {
name: "H4V3",
tpoints: 1337
}, {
name: "B33N",
tpoints: 1337
}, {
name: "PWN3D",
tpoints: 404
}]);
return;
}

const response = await axios.get(`${BACKEND_URL}/leaderboard`, {
headers: {
Authorization: `Bearer ${window.localStorage.getItem("token")}`,
Expand Down

0 comments on commit a7ef3a5

Please sign in to comment.