@exodus/react-native-webview 11.26.1-exodus.34 → 11.26.1-exodus.35
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/lib/WebViewShared.js +9 -3
- package/package.json +2 -1
package/lib/WebViewShared.js
CHANGED
|
@@ -144,9 +144,15 @@ export const useWebWiewLogic = ({ startInLoadingState, onLoadStart, onLoad, onLo
|
|
|
144
144
|
if (!passesWhitelistUse(nativeEvent.url))
|
|
145
145
|
return;
|
|
146
146
|
// TODO: can/should we perform any other validation?
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
try {
|
|
148
|
+
const parsedData = JSON.parse(nativeEvent.data);
|
|
149
|
+
const data = JSON.stringify(validateData(parsedData));
|
|
150
|
+
const meta = validateMeta(extractMeta(nativeEvent));
|
|
151
|
+
onMessageProp === null || onMessageProp === void 0 ? void 0 : onMessageProp({ ...meta, data });
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
console.error('Error parsing WebView message', err);
|
|
155
|
+
}
|
|
150
156
|
}, [onMessageProp, passesWhitelistUse, validateData, validateMeta]);
|
|
151
157
|
const onLoadingProgress = useCallback((event) => {
|
|
152
158
|
const { nativeEvent: { progress } } = event;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"Thibault Malbranche <malbranche.thibault@gmail.com>"
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "11.26.1-exodus.
|
|
12
|
+
"version": "11.26.1-exodus.35",
|
|
13
13
|
"homepage": "https://github.com/ExodusMovement/react-native-webview#readme",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"android": "react-native run-android",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"files": [
|
|
73
73
|
"android",
|
|
74
74
|
"!android/.gradle",
|
|
75
|
+
"!android/build",
|
|
75
76
|
"apple",
|
|
76
77
|
"ios",
|
|
77
78
|
"lib",
|