Skip to content

Commit

Permalink
update plan type if present
Browse files Browse the repository at this point in the history
  • Loading branch information
notshivansh committed Dec 30, 2024
1 parent bff0279 commit d8fe3b6
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,21 @@ function Billing() {
default:
}

if (window.PLAN_TYPE) { $('.stigg-subscription-plan-name').text(window.PLAN_TYPE) }
if (window.PLAN_TYPE && window.PLAN_TYPE.length > 0) {
const observer = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
const elements = document.querySelectorAll('.stigg-subscription-plan-name');
if (elements.length > 0) {
elements.forEach(element => {
element.textContent = window.PLAN_TYPE;
});
observer.disconnect(); // Stop observing once the element is found
}
}
});
observer.observe(document.body, { childList: true, subtree: true });
return () => observer.disconnect(); // Cleanup on unmount
}
})

async function refreshUsageData(){
Expand Down

0 comments on commit d8fe3b6

Please sign in to comment.