Skip to content

Commit

Permalink
Merge pull request #237 from starknet-id/fix/task-opens-on-click-veri…
Browse files Browse the repository at this point in the history
…fy-button

fix: task opens on click verify button
  • Loading branch information
fricoben authored Oct 12, 2023
2 parents 38476ae + 3534f59 commit 4a569d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/quests/task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ const Task: FunctionComponent<Task> = ({
};

// A verify function that setIsVerified(true) and stop propagation
const verify = async (e?: React.MouseEvent) => {
const verify = async () => {
checkCanDoTask();
if (e) e.stopPropagation();
setIsLoading(true);

if (verifyEndpointType.startsWith("oauth")) {
Expand Down Expand Up @@ -159,11 +158,12 @@ const Task: FunctionComponent<Task> = ({
) : (
<div
onClick={(e) => {
e.stopPropagation();
if (!address) return setError("Please connect your wallet first");
if (!hasRootDomain) return setShowDomainPopup(true);
if (verifyEndpointType === "quiz") return openTask();
if (verifyRedirect) window.open(verifyRedirect);
verify(e);
verify();
}}
className={styles.verifyButton}
>
Expand Down

1 comment on commit 4a569d6

@vercel
Copy link

@vercel vercel bot commented on 4a569d6 Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.