Advertisement
Guest User

ropro cracked

a guest
Nov 10th, 2024
2,038
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. async function fetchSubscription() {
  2. return new Promise((resolve) => {
  3. resolve("pro_tier");
  4. });
  5. }
  6.  
  7. var subscriptionPromise = [];
  8.  
  9. async function getSubscription() {
  10. if (subscriptionPromise.length === 0) {
  11. subscriptionPromise.push(
  12. new Promise(async (resolve) => {
  13. const freshness = await getLocalStorage("rpSubscriptionFreshness");
  14. if (!freshness || Date.now() >= freshness + 300 * 1000) {
  15. try {
  16. await validateUser();
  17. const subscription = await fetchSubscription();
  18. setLocalStorage("rpSubscription", subscription);
  19. setLocalStorage("rpSubscriptionFreshness", Date.now());
  20. resolve(subscription);
  21. } catch (e) {
  22. console.log("Error fetching subscription: ", e);
  23. setLocalStorage("rpSubscriptionFreshness", Date.now());
  24. }
  25. } else {
  26. resolve(await getLocalStorage("rpSubscription"));
  27. }
  28. })
  29. );
  30. }
  31.  
  32. const myPromise = await subscriptionPromise[0];
  33. subscriptionPromise = [];
  34. return myPromise;
  35. }
  36.  
  37. getSubscription();
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement