Skip to content

Commit

Permalink
fix: update timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Jan 25, 2024
1 parent 54cb068 commit 2239b7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/quests/questDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ const QuestDetails: FunctionComponent<QuestDetailsProps> = ({
verifyRedirect={task.verify_redirect}
verifyEndpoint={
task.verify_endpoint_type &&
task.verify_endpoint_type === "default"
task.verify_endpoint_type.startsWith("default")
? `${task.verify_endpoint}?addr=${hexToDecimal(address)}`
: task.verify_endpoint_type === "quiz"
? task.verify_endpoint
Expand Down
8 changes: 6 additions & 2 deletions components/quests/task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ const Task: FunctionComponent<Task> = ({
}

if (verifyRedirect) {
// if the redirect is to a realm, we set a timeout of 2 minutes
const timeout = verifyRedirect.includes("realms") ? 120000 : 15000;
// if the verify_endpoint_type contains a timeout indication we use it,
// otherwise we use the default timeout of 15 seconds
const timeout =
verifyEndpointType.split("_").length === 2
? parseInt(verifyEndpointType.split("_")[1]) ?? 15000
: 15000;
await new Promise((resolve) =>
setTimeout(() => {
setIsVerified(true);
Expand Down

0 comments on commit 2239b7e

Please sign in to comment.