@opexa/portal-sdk 0.59.94 → 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/README.md +1634 -1634
- package/dist/{chunk-5WRVWQBT.js → chunk-7APXFZ5G.js} +3 -3
- package/dist/chunk-7APXFZ5G.js.map +1 -0
- package/dist/{chunk-4TI5IXXM.js → chunk-RCMZBLLX.js} +3 -3
- package/dist/chunk-RCMZBLLX.js.map +1 -0
- package/dist/{chunk-ROBGEUSE.js → chunk-WVFSGB7Y.js} +2 -2
- package/dist/chunk-WVFSGB7Y.js.map +1 -0
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-4TI5IXXM.js.map +0 -1
- package/dist/chunk-5WRVWQBT.js.map +0 -1
- package/dist/chunk-ROBGEUSE.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { CmsPortalService, GameService, ExtensionService, FileService, WalletService, AccountService, ReportService, PortalService, TriggerService, AuthService, getFingerPrint } from './chunk-
|
|
2
|
-
import { GraphQLClient, isPlainObject } from './chunk-
|
|
3
|
-
import './chunk-
|
|
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
|
+
import { App } from '@capacitor/app';
|
|
6
7
|
import { Capacitor } from '@capacitor/core';
|
|
7
8
|
import cookies from 'js-cookie';
|
|
8
9
|
|
|
@@ -3530,10 +3531,14 @@ var Sdk = class {
|
|
|
3530
3531
|
const interval = clamp(input.interval ?? 3e4, 5e3, 6e4);
|
|
3531
3532
|
let counter = 0;
|
|
3532
3533
|
let timeout = null;
|
|
3534
|
+
let isForeground = true;
|
|
3535
|
+
const listener = App.addListener("appStateChange", ({ isActive }) => {
|
|
3536
|
+
isForeground = isActive;
|
|
3537
|
+
});
|
|
3533
3538
|
const assignTimeout = () => {
|
|
3534
3539
|
const duration = counter <= 0 ? interval * 0.5 : interval;
|
|
3535
3540
|
return setTimeout(async () => {
|
|
3536
|
-
{
|
|
3541
|
+
if (isForeground) {
|
|
3537
3542
|
let res;
|
|
3538
3543
|
try {
|
|
3539
3544
|
res = await this.sessionManager.verify();
|
|
@@ -3553,6 +3558,7 @@ var Sdk = class {
|
|
|
3553
3558
|
if (timeout) {
|
|
3554
3559
|
clearTimeout(timeout);
|
|
3555
3560
|
}
|
|
3561
|
+
listener.then((handle) => handle.remove());
|
|
3556
3562
|
};
|
|
3557
3563
|
}
|
|
3558
3564
|
async session() {
|