Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get code button working only one time #44

Merged
merged 2 commits into from
Jul 24, 2024
Merged

Conversation

devansh016
Copy link
Member

@devansh016 devansh016 commented Jul 19, 2024

Issue: Get code button only works for 1st time

This fixes: #42

Problem

Placeholders in the HTML template (e.g., {{curr_domain}}) were replaced only on first click of "Get Code". Subsequent attempts failed as placeholders were already replaced.

Solution

  • Store original HTML template with placeholders in a data attribute on first run.
  • For each generation:
    • Retrieve stored template
    • Replace placeholders
    • Update HTML

This allows multiple code generations without page refresh, improving user experience.

@devansh016 devansh016 marked this pull request as ready for review July 19, 2024 11:17
@devansh016 devansh016 changed the base branch from master to develop July 23, 2024 10:35
js/b2w-redirection-ajax.js Show resolved Hide resolved
js/b2w-redirection-ajax.js Outdated Show resolved Hide resolved
@pavanpatil1
Copy link
Contributor

Verified the fix and it is working fine. The get code button is working properly.

getcode.webm

Copy link
Member

@Pathan-Amaankhan Pathan-Amaankhan left a comment

Choose a reason for hiding this comment

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

Approved on the basis of #44 (comment)

@devansh016 devansh016 merged commit da2c206 into develop Jul 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get code button not working to get code for another blogs
3 participants