Skip to content

Commit

Permalink
Wait for 3 seconds before checking the actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillweston committed Apr 25, 2024
1 parent f779950 commit bac3713
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ <h3>Authorize Your Twitter to Unlock</h3>
<form>
<div class="input-group contact-input mb-3">
<input id="promotion-code-input" type="text" class="form-control box-bg" placeholder="Input promotion code here..." aria-label="Username">
<button id="promotion-code-check-btn" class="check-btn" onclick="checkPromotionCode(event)"><i class="fa fa-arrow-down" aria-hidden="true"></i></button>
<button type="button" id="promotion-code-check-btn" class="check-btn" onclick="checkPromotionCode(event)"><i class="fa fa-arrow-down" aria-hidden="true"></i></button>
</div>
<div id="promotion-input-error" class="error-message"></div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion js/claim-airdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ async function confirmTransaction() {
return;
}
let url = null;
if (promotionCode) {
if (promotionCode && twitterSteps !== 0) {
url = authWebAddress + `/send-airdrop-parent?address=${encodeURIComponent(fullAddress)}&step=${twitterSteps}`;

const response = await fetch(url);
Expand Down
16 changes: 8 additions & 8 deletions js/twitter-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,10 @@ async function handleAction(action) {
default:
break;
}
checkAllActionsDisabled();
// Wait for 3 seconds
setTimeout(() => {
checkAllActionsDisabled();
}, 3000);
} catch (error) {
console.error(`Error performing ${action}:`, error);
displayInfo(action, `Action error: ${error.message}`, 'error');
Expand All @@ -255,13 +258,10 @@ function checkAllActionsDisabled() {
const isFollowUsDisabled = document.getElementById('follow-section').classList.contains('disabled');
if (isRetweetDisabled && isLikeDisabled && isRetweet2Disabled && isFollowUsDisabled) {
document.getElementById('promotionCodeInput').style.display = 'block';
// Wait for 3 seconds
setTimeout(() => {
document.getElementById('retweet-section').style.display = 'none';
document.getElementById('like-section').style.display = 'none';
document.getElementById('retweet-section-2').style.display = 'none';
document.getElementById('follow-section').style.display = 'none';
}, 3000);
document.getElementById('retweet-section').style.display = 'none';
document.getElementById('like-section').style.display = 'none';
document.getElementById('retweet-section-2').style.display = 'none';
document.getElementById('follow-section').style.display = 'none';
}
}

Expand Down

0 comments on commit bac3713

Please sign in to comment.