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 CHANGED
@@ -182,7 +182,7 @@ export default (props) => {
182
182
  : 0;
183
183
  const isExpand = expands[item.id];
184
184
  const bookmarkColor = props.bookmarks[item.id];
185
- const color = item.isMocked
185
+ const color = !!item.mockid
186
186
  ? "blue"
187
187
  : hasResponse
188
188
  ? item.response.error
@@ -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
- isMocked: undefined,
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), isMocked: !!data.isMocked, interface: data.interface },
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
- isMocked: !!mock,
204
+ mockid: mock?.id,
205
205
  interface: 'axios',
206
206
  });
207
207
  }
@@ -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
- useEffect(() => {
76
- try {
77
- setCanReset(JSON.stringify(p.mockDetails, removeId) != tmpMockDetails);
78
- } catch (e) {
79
- setCanReset(true);
80
- }
81
- }, [p.mockDetails, tmpMockDetails]);
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.isMocked).length;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-in-app-debugger",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "This library's main usage is to be used by Non-Technical testers during UAT, SIT or any testing phase.",
5
5
  "main": "index.jsx",
6
6
  "scripts": {
@@ -0,0 +1 @@
1
+ export default {}