@opexa/portal-sdk 0.59.93 → 0.59.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { CmsPortalService, GameService, ExtensionService, FileService, WalletService, AccountService, ReportService, PortalService, TriggerService, AuthService, getFingerPrint } from './chunk-4TI5IXXM.js';
2
- import { GraphQLClient, isPlainObject } from './chunk-5WRVWQBT.js';
3
- import './chunk-ROBGEUSE.js';
1
+ import { CmsPortalService, GameService, ExtensionService, FileService, WalletService, AccountService, ReportService, PortalService, TriggerService, AuthService, getFingerPrint } from './chunk-RCMZBLLX.js';
2
+ import { GraphQLClient, isPlainObject } from './chunk-7APXFZ5G.js';
3
+ import './chunk-WVFSGB7Y.js';
4
4
  import { ObjectId } from '@opexa/object-id';
5
5
  export { ObjectId } from '@opexa/object-id';
6
6
  import { App } from '@capacitor/app';
@@ -3529,12 +3529,14 @@ var Sdk = class {
3529
3529
  }
3530
3530
  watchSession(input) {
3531
3531
  const interval = clamp(input.interval ?? 3e4, 5e3, 6e4);
3532
+ let counter = 0;
3532
3533
  let timeout = null;
3533
3534
  let isForeground = true;
3534
3535
  const listener = App.addListener("appStateChange", ({ isActive }) => {
3535
3536
  isForeground = isActive;
3536
3537
  });
3537
3538
  const assignTimeout = () => {
3539
+ const duration = counter <= 0 ? interval * 0.5 : interval;
3538
3540
  return setTimeout(async () => {
3539
3541
  if (isForeground) {
3540
3542
  let res;
@@ -3547,8 +3549,9 @@ var Sdk = class {
3547
3549
  await input.onInvalid(res.reason ?? "INVALID_SESSION");
3548
3550
  }
3549
3551
  }
3552
+ counter += 1;
3550
3553
  timeout = assignTimeout();
3551
- }, interval);
3554
+ }, duration);
3552
3555
  };
3553
3556
  timeout = assignTimeout();
3554
3557
  return function unsubscribe() {