react-native-in-app-debugger 2.0.3 → 2.0.4
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/Api/index.jsx +1 -1
- package/Api/useApiInterceptor.js +3 -3
- package/Mock/MockDetails.jsx +18 -8
- package/index.jsx +1 -1
- package/package.json +1 -1
- package/parentDependencies.js +1 -0
package/Api/index.jsx
CHANGED
package/Api/useApiInterceptor.js
CHANGED
|
@@ -49,12 +49,12 @@ export default ({ maxNumOfApiToStore, blacklists, blacklistRef, mocks }) => {
|
|
|
49
49
|
timestamp: performance.now(),
|
|
50
50
|
datetime: new Date().toLocaleString(),
|
|
51
51
|
time: `${hour}:${minute}:${second}`,
|
|
52
|
-
|
|
52
|
+
mockid: undefined,
|
|
53
53
|
interface: undefined
|
|
54
54
|
};
|
|
55
55
|
setApis((v) => {
|
|
56
56
|
const newData = [
|
|
57
|
-
{ request, id: Date.now().toString(36) + Math.random().toString(36),
|
|
57
|
+
{ request, id: Date.now().toString(36) + Math.random().toString(36), mockid: !!data.mockid, interface: data.interface },
|
|
58
58
|
...(maxNumOfApiToStore ? v.slice(0, maxNumOfApiToStore - 1) : v),
|
|
59
59
|
];
|
|
60
60
|
return newData;
|
|
@@ -201,7 +201,7 @@ export default ({ maxNumOfApiToStore, blacklists, blacklistRef, mocks }) => {
|
|
|
201
201
|
headers,
|
|
202
202
|
method,
|
|
203
203
|
data,
|
|
204
|
-
|
|
204
|
+
mockid: mock?.id,
|
|
205
205
|
interface: 'axios',
|
|
206
206
|
});
|
|
207
207
|
}
|
package/Mock/MockDetails.jsx
CHANGED
|
@@ -61,7 +61,7 @@ export default (p) => {
|
|
|
61
61
|
setTmpResStatus(p.mockDetails.response.status + '' || '');
|
|
62
62
|
};
|
|
63
63
|
useEffect(reset, [p.mockDetails]);
|
|
64
|
-
const [canReset, setCanReset] = useState(false);
|
|
64
|
+
// const [canReset, setCanReset] = useState(false);
|
|
65
65
|
|
|
66
66
|
const parse = (data) => {
|
|
67
67
|
try {
|
|
@@ -72,16 +72,26 @@ export default (p) => {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
75
|
+
// console.log('xxxxx mock details', JSON.stringify(p.mockDetails, removeId)?.replace(/\s+/g, ""))
|
|
76
|
+
// console.log('xxxxx tmpMockDetails', tmpMockDetails?.replace?.(/\s+/g, ""))
|
|
77
|
+
|
|
78
|
+
// useEffect(() => {
|
|
79
|
+
// try {
|
|
80
|
+
// setCanReset(JSON.stringify(p.mockDetails, removeId)?.replace(/\s+/g, "") != tmpMockDetails?.replace?.(/\s+/g, ""));
|
|
81
|
+
// } catch (e) {
|
|
82
|
+
// setCanReset(true);
|
|
83
|
+
// }
|
|
84
|
+
// }, [p.mockDetails, tmpMockDetails]);
|
|
82
85
|
if (!p.mockDetails) return null;
|
|
86
|
+
// const canReset = JSON.stringify(p.mockDetails, removeId)?.replace(/\s+/g, '') !== tmpMockDetails?.replace?.(/\s+/g, '');
|
|
87
|
+
const canReset =
|
|
88
|
+
tmpResStatus != p.mockDetails.response.status ||
|
|
89
|
+
JSON.stringify(p.mockDetails.response.data)?.replace(/\s+/g, '') !== tmpResBody?.replace?.(/\s+/g, '');
|
|
83
90
|
const isnew = !p.mocks.some((m) => m.id === p.mockDetails.id);
|
|
84
91
|
|
|
92
|
+
console.log('xxxxx response', JSON.stringify(p.mockDetails.response.data)?.replace(/\s+/g, ''));
|
|
93
|
+
console.log('xxxxx tmpResBody', tmpResBody?.replace?.(/\s+/g, ''));
|
|
94
|
+
|
|
85
95
|
return (
|
|
86
96
|
<View
|
|
87
97
|
style={{
|
package/index.jsx
CHANGED
|
@@ -126,7 +126,7 @@ export default ({
|
|
|
126
126
|
|
|
127
127
|
const numErrorApiCalls = apis.filter((a) => a.response?.error).length;
|
|
128
128
|
const numPendingApiCalls = apis.filter((a) => !a.response).length;
|
|
129
|
-
const numMockedApiCalls = apis.filter((a) => a.
|
|
129
|
+
const numMockedApiCalls = apis.filter((a) => !!a.mockid).length;
|
|
130
130
|
let badgeHeight = fontSize * 3;
|
|
131
131
|
|
|
132
132
|
const displayLabels = [
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|