Skip to content
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

solve third party cookies issue #799

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/web/src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export enum ScreenSize {
export const MAX_NFT_TIER = 3;

// export const stagingServiceUrl = "https://rl848xdj4k.execute-api.us-east-1.amazonaws.com/staging";
export const stagingServiceUrl = "https://hats-backend-dev.herokuapp.com/v1";
export const prodServiceUrl = "https://hats-backend-prod.herokuapp.com/v1";
export const stagingServiceUrl = "https://dev.hats.finance/v1";
export const prodServiceUrl = "https://prod.hats.finance/v1";

export const auditWizardVerifyService = "https://app.auditwizard.io:5000/submissions/finalizeHats";

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@
"linesOfCode": "Lines of code (LoC)",
"issueAlreadyHaveValidSubmission": "This issue already have a valid submission. You can submit complementary submission in other issue.",
"oneSubmissionIsBeingReviewed": "One submission is being reviewed. Please wait, if the submission is not complete, you can submit another one.",
"vaultIsNotLive": "This vault is not live",
"MyWallet": {
"overview": "Overview",
"pointValue": "Point value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import { Button, HackerProfileImage, Loading, Pill, WithTooltip } from "componen
import { useSiweAuth } from "hooks/siwe/useSiweAuth";
import useConfirm from "hooks/useConfirm";
import moment from "moment";
import { RoutePaths } from "navigation";
import { useProfileByAddress } from "pages/HackerProfile/hooks";
import { useAllTimeLeaderboard } from "pages/Leaderboard/LeaderboardPage/components/AllTimeLeaderboard/useAllTimeLeaderboard";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
import { IS_PROD, appChains } from "settings";
import { useAccount, useNetwork } from "wagmi";
import { useClaimIssue, useClaimedIssuesByVault } from "../hooks";
Expand All @@ -35,6 +37,9 @@ export const SplitPointsActions = ({ vault, submission, linkedPRs }: SplitPoints
const { chain } = useNetwork();
const { tryAuthentication } = useSiweAuth();
const confirm = useConfirm();
const navigate = useNavigate();

const isVaultLive = vault.dateStatus === "on_time";

const { leaderboard } = useAllTimeLeaderboard("all", "streak");
const { data: profile } = useProfileByAddress(address);
Expand Down Expand Up @@ -69,6 +74,7 @@ export const SplitPointsActions = ({ vault, submission, linkedPRs }: SplitPoints
const isOpenToSubmissions = linkedPRs.length === 0 ? true : linkedPRs?.every((pr) => pr.bonusSubmissionStatus === "INCOMPLETE");

const canExecuteAction = () => {
if (!isVaultLive) return { can: false, reason: t("vaultIsNotLive") };
if (isClaimedByCurrentUser) return { can: true };
if (claimedByInfo) return { can: false, reason: t("issueAlreadyClaimed") };

Expand Down Expand Up @@ -137,6 +143,11 @@ export const SplitPointsActions = ({ vault, submission, linkedPRs }: SplitPoints
const handleClaimIssue = async () => {
if (!canExecuteAction().can) return;

if (isClaimedByCurrentUser) {
navigate(`${RoutePaths.vulnerability}?projectId=${vault.id}`);
return;
}

const wantsToClaim = await confirm({
title: t("claimIssue"),
titleIcon: <FlagIcon className="mr-2" fontSize="large" />,
Expand Down
Loading