Glench/ExtPay

openTrialPage creates an infinity loop and continuously opens in dev mode

Opened this issue · 1 comments

Describe the bug
A clear and concise description of what the bug is.
I've tried tried a simple instance of invoking the trail page, and it is getting called in an infinite loop: if (!window.location.href.startsWith('chrome://extensions/')){ extpay.getUser().then(user => { if (user.trialStartedAt == null){ try{ extpay.openTrialPage("7-day"); } catch(e){ console.log("error", e); } } else if(user.trialStartedAt != null && (now - user.trialStartedAt) > sevenDays && (!user.paid)) { extpay.openPaymentPage() userGood = false } }); }
To Reproduce
Steps to reproduce the behavior:
try and use openTrialPage, and you will get the popup stuck in an infinity loop of opening itself up.

Expected behavior
This should only open up once
Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [iOS]
  • Browser [chrome]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. macOS]
  • OS:14.0 (23A344)
  • Browser [chrome]
  • Version [latest]

Additional context
Add any other context about the problem here.

Screenshot 2024-09-07 at 10 33 49 AM
I think this code is the issue, I'm already listening to messages on the chrome runtime, and doing things that sends messages like taking screenshots, hence the infinite loop that it gets stuck in, is there a way I can edit this so I can send a message in a different way?