esoftplay 0.0.245 → 0.0.247
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/modules/lib/curl.ts +2 -4
- package/modules/lib/version.tsx +14 -2
- package/package.json +1 -1
package/modules/lib/curl.ts
CHANGED
|
@@ -6,13 +6,11 @@ import esp from 'esoftplay/esp';
|
|
|
6
6
|
|
|
7
7
|
//api_logger_import
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
/** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/curl.md) untuk melihat dokumentasi*/
|
|
11
10
|
export default class m {
|
|
12
11
|
controller = new AbortController()
|
|
13
12
|
signal = this.controller.signal
|
|
14
13
|
timeout = 30000;
|
|
15
|
-
// maxRetry = 3;
|
|
16
14
|
resStatus?: number = undefined
|
|
17
15
|
timeoutContext: any = null;
|
|
18
16
|
isDebug = esp.config("isDebug");
|
|
@@ -56,9 +54,9 @@ export default class m {
|
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
/** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/curl.md#await) untuk melihat dokumentasi*/
|
|
59
|
-
static async(uriOrUrl: string, post
|
|
57
|
+
static async(uriOrUrl: string, post?: any): Promise<{ ok: 0 | 1, message: string, result: any }> {
|
|
60
58
|
return new Promise((resolve, reject) => {
|
|
61
|
-
new (
|
|
59
|
+
new (m)(uriOrUrl, post,
|
|
62
60
|
(result, message) => {
|
|
63
61
|
resolve({ ok: 1, result, message })
|
|
64
62
|
},
|
package/modules/lib/version.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
|
8
8
|
import { LibTextstyle } from 'esoftplay/cache/lib/textstyle/import';
|
|
9
9
|
import { LibUpdaterProperty } from 'esoftplay/cache/lib/updater/import';
|
|
10
10
|
import esp from 'esoftplay/esp';
|
|
11
|
+
import useGlobalState from 'esoftplay/global';
|
|
11
12
|
import * as Application from 'expo-application';
|
|
12
13
|
|
|
13
14
|
import { BackHandler, ImageBackground, Linking, Platform, TouchableOpacity } from 'react-native';
|
|
@@ -17,6 +18,9 @@ export interface LibVersionProps {
|
|
|
17
18
|
export interface LibVersionState {
|
|
18
19
|
|
|
19
20
|
}
|
|
21
|
+
|
|
22
|
+
const isFirstOpen = useGlobalState(1, { persistKey: "lib/version.isFirstOpen", inFastStorage: true, loadOnInit: true })
|
|
23
|
+
|
|
20
24
|
/** Klik [disini](https://github.com/dev-esoftplay/mobile-docs/blob/main/modules/lib/version.md) untuk melihat dokumentasi*/
|
|
21
25
|
export default class m extends LibComponent<LibVersionProps, LibVersionState> {
|
|
22
26
|
|
|
@@ -60,9 +64,17 @@ export default class m extends LibComponent<LibVersionProps, LibVersionState> {
|
|
|
60
64
|
LibNavigation.replace("lib/version", { res, msg: msg == 'success' ? 'Update to a new version now' : msg })
|
|
61
65
|
} else {
|
|
62
66
|
const currentVersion = esp.config('publish_id')
|
|
63
|
-
|
|
67
|
+
// Alert.alert("ForceUpdate", JSON.stringify({ res, isFirstOpen: isFirstOpen.get() }, undefined, 2))
|
|
68
|
+
if (((currentVersion < version_publish) || (isFirstOpen.get() == 1 && res.app_update == 1)) && !__DEV__) {
|
|
69
|
+
isFirstOpen.set(0)
|
|
64
70
|
LibNavigation.reset("lib/version_view")
|
|
65
|
-
LibUpdaterProperty.check((isNew) => {
|
|
71
|
+
LibUpdaterProperty.check((isNew) => {
|
|
72
|
+
if (isNew) {
|
|
73
|
+
LibUpdaterProperty.install()
|
|
74
|
+
} else {
|
|
75
|
+
LibNavigation.reset()
|
|
76
|
+
}
|
|
77
|
+
})
|
|
66
78
|
}
|
|
67
79
|
}
|
|
68
80
|
}
|