@vetc-miniapp/apis 0.0.2 → 0.0.3
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/package.json +1 -1
- package/src/apis/index.js +1 -9
package/package.json
CHANGED
package/src/apis/index.js
CHANGED
|
@@ -6,15 +6,6 @@ const getBridge = () => {
|
|
|
6
6
|
}
|
|
7
7
|
return window.flutter_inappwebview;
|
|
8
8
|
};
|
|
9
|
-
const isBrowser = typeof window !== "undefined";
|
|
10
|
-
|
|
11
|
-
const getBridge = () => {
|
|
12
|
-
if (!isBrowser || !window.flutter_inappwebview) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
return window.flutter_inappwebview;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
9
|
export const callHost = async (action, payload = {}) => {
|
|
19
10
|
const bridge = getBridge();
|
|
20
11
|
if (!bridge) {
|
|
@@ -25,6 +16,7 @@ export const callHost = async (action, payload = {}) => {
|
|
|
25
16
|
action,
|
|
26
17
|
payload,
|
|
27
18
|
});
|
|
19
|
+
console.log("Bridge response:", response);
|
|
28
20
|
|
|
29
21
|
return response;
|
|
30
22
|
} catch (error) {
|