Skip to content

Commit

Permalink
fix: task opens on click verify button
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchand-Nicolas committed Oct 11, 2023
1 parent fb0b48a commit 3534f59
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

0 comments on commit 3534f59

Please sign in to comment.