@hot-updater/react-native 0.4.1-4 → 0.5.0
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.
|
@@ -59,6 +59,13 @@ class HotUpdater : ReactPackage {
|
|
|
59
59
|
putString("HotUpdaterBundleURL", bundleURL)
|
|
60
60
|
apply()
|
|
61
61
|
}
|
|
62
|
+
val reactIntegrationManager = ReactIntegrationManager(context)
|
|
63
|
+
|
|
64
|
+
val activity: Activity? = getCurrentActivity(context)
|
|
65
|
+
val reactApplication: ReactApplication = reactIntegrationManager.getReactApplication(activity?.application)
|
|
66
|
+
val bundleURL = getJSBundleFile(context)
|
|
67
|
+
|
|
68
|
+
reactIntegrationManager.setJSBundle(reactApplication, bundleURL)
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
private fun extractZipFileAtPath(
|
|
@@ -93,9 +100,9 @@ class HotUpdater : ReactPackage {
|
|
|
93
100
|
}
|
|
94
101
|
|
|
95
102
|
fun reload(context: Context) {
|
|
96
|
-
val activity: Activity? = getCurrentActivity(context)
|
|
97
103
|
val reactIntegrationManager = ReactIntegrationManager(context)
|
|
98
104
|
|
|
105
|
+
val activity: Activity? = getCurrentActivity(context)
|
|
99
106
|
val reactApplication: ReactApplication = reactIntegrationManager.getReactApplication(activity?.application)
|
|
100
107
|
val bundleURL = getJSBundleFile(context)
|
|
101
108
|
|
package/dist/index.js
CHANGED
|
@@ -1831,7 +1831,7 @@ function wrap(config) {
|
|
|
1831
1831
|
config.source,
|
|
1832
1832
|
config.requestHeaders
|
|
1833
1833
|
]);
|
|
1834
|
-
if (config.fallbackComponent && (!isCheckUpdateCompleted || progress > 0)) {
|
|
1834
|
+
if (config.fallbackComponent && (!isCheckUpdateCompleted || progress > 0 && progress < 1)) {
|
|
1835
1835
|
const Fallback = config.fallbackComponent;
|
|
1836
1836
|
return /*#__PURE__*/ React.createElement(Fallback, {
|
|
1837
1837
|
progress: progress
|
package/dist/index.mjs
CHANGED
|
@@ -1799,7 +1799,7 @@ function wrap(config) {
|
|
|
1799
1799
|
config.source,
|
|
1800
1800
|
config.requestHeaders
|
|
1801
1801
|
]);
|
|
1802
|
-
if (config.fallbackComponent && (!isCheckUpdateCompleted || progress > 0)) {
|
|
1802
|
+
if (config.fallbackComponent && (!isCheckUpdateCompleted || progress > 0 && progress < 1)) {
|
|
1803
1803
|
const Fallback = config.fallbackComponent;
|
|
1804
1804
|
return /*#__PURE__*/ React.createElement(Fallback, {
|
|
1805
1805
|
progress: progress
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "React Native OTA solution for self-hosted",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"react-native-builder-bob": "^0.33.1"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@hot-updater/js": "0.
|
|
79
|
-
"@hot-updater/core": "0.
|
|
78
|
+
"@hot-updater/js": "0.5.0",
|
|
79
|
+
"@hot-updater/core": "0.5.0"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"build": "rslib build",
|
package/src/wrap.tsx
CHANGED
|
@@ -121,7 +121,7 @@ export function wrap<P>(
|
|
|
121
121
|
|
|
122
122
|
if (
|
|
123
123
|
config.fallbackComponent &&
|
|
124
|
-
(!isCheckUpdateCompleted || progress > 0)
|
|
124
|
+
(!isCheckUpdateCompleted || (progress > 0 && progress < 1))
|
|
125
125
|
) {
|
|
126
126
|
const Fallback = config.fallbackComponent;
|
|
127
127
|
return <Fallback progress={progress} />;
|