esoftplay 0.0.246 → 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/version.tsx +14 -2
- package/package.json +1 -1
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
|
}
|