Skip to content

Commit

Permalink
fix: twitter tasks open even if not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Aug 7, 2023
1 parent 13e46ba commit eb54f2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/quests/task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ const Task: FunctionComponent<Task> = ({
// A verify function that setIsVerified(true) and stop propagation
const verify = async (e: React.MouseEvent) => {
e.stopPropagation();
if (!address) {
setError("Please connect your wallet first");
return;
}
setIsLoading(true);

if (verifyEndpointType.startsWith("oauth")) {
Expand Down Expand Up @@ -125,7 +129,7 @@ const Task: FunctionComponent<Task> = ({
) : (
<div
onClick={(e) => {
if (verifyRedirect) window.open(verifyRedirect);
if (verifyRedirect && address) window.open(verifyRedirect);
verify(e);
}}
className={styles.verifyButton}
Expand Down

0 comments on commit eb54f2b

Please sign in to comment.