I have a bug that when i call a function when the alert is closed for two different alerts separately it calls both the function then.
(The second alert is the child of the callback function of first alert)
Suggestion :- You can return a promise so that rest things can be written inside .then()
(If you want to check my code the i have commented it in your solo learn documentation.)