Closed himanshugarg closed 2 years ago
@Rumyra @dipikabh This PR is ready to be merged but I can’t merge it myself because I don’t have merge permissions for this repo.
@teoli2003 was this resolved when you modernised the code examples?
Yes, though I put the label change inside the stop button click
event handler:
// Close the audiocontext
stopBtn.onclick = () => {
audioCtx.close().then(() => {
startBtn.removeAttribute("disabled");
susresBtn.setAttribute("disabled", "disabled");
// Reset the text of the suspend/resume toggle:
susresBtn.textContent = "Suspend context";
stopBtn.setAttribute("disabled", "disabled");
});
};
@himanshugarg thanks so much for your fix and sorry for taking so long to get to it. It seems some work @teoli2003 did recently to update these examples has fixed the issue. In which case we can close this pr and the associated issue. Thanks again for the contribution 👍
See https://github.com/mdn/content/issues/9451
The sequence
Create context; Suspend context; Stop context;
leaves the label of thesusresBtn
asResume context
The proposed fix refreshes the label on Start