jwplayer / ott-web-app

Reference implementation for JWP-powered apps
Apache License 2.0
69 stars 52 forks source link

Feat / subscription retry logic #508

Closed royschut closed 1 month ago

royschut commented 2 months ago

(Copy of #483, which was automatically closed when its base PR (#494) was merged, and I couldn't reopen)

Access check retry mechanism

This PR adds a retry mechanism to the access check (reloadActiveSubscription()), to make sure that the UI notices granted access, even if the backend takes longer to process a purchase. This also makes it possible to reduce the initial delay. Note: I've left the initial delay after a subscription switch on 3000ms, because a switch presumably always takes long (it was initially set to 7500).