react-native-in-app-debugger 1.0.17 → 1.0.19
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.jsx +7 -8
- package/index.jsx +3 -3
- package/package.json +1 -1
package/Api.jsx
CHANGED
|
@@ -84,18 +84,15 @@ const Row = ({ item }) => {
|
|
|
84
84
|
);
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
+
const isError = (a) => a.response?.status < 200 || a.response?.status >= 400;
|
|
87
88
|
export default (props) => {
|
|
88
89
|
const [filter, setFilter] = useState("");
|
|
89
90
|
const [errorOnly, setErrorOnly] = useState(false);
|
|
90
91
|
const [filterUrlOnly, setFilterUrlOnly] = useState(true);
|
|
91
92
|
const [expands, setExpands] = useState({});
|
|
92
|
-
const apis = props.apis.filter(
|
|
93
|
-
(a) => !errorOnly || a.response?.status < 200 || a.response?.status >= 400
|
|
94
|
-
);
|
|
93
|
+
const apis = props.apis.filter((a) => !errorOnly || isError(a));
|
|
95
94
|
|
|
96
|
-
const hasError = apis.some(
|
|
97
|
-
(a) => a.response?.status < 200 || a.response?.status >= 400
|
|
98
|
-
);
|
|
95
|
+
const hasError = apis.some(isError);
|
|
99
96
|
|
|
100
97
|
return (
|
|
101
98
|
<>
|
|
@@ -117,7 +114,9 @@ export default (props) => {
|
|
|
117
114
|
])
|
|
118
115
|
}
|
|
119
116
|
>
|
|
120
|
-
<Text style={{ color: "black" }}>
|
|
117
|
+
<Text style={{ color: "black" }}>
|
|
118
|
+
Clear {props.apis.length} APIs
|
|
119
|
+
</Text>
|
|
121
120
|
</TouchableOpacity>
|
|
122
121
|
)}
|
|
123
122
|
{hasError && !filter && (
|
|
@@ -131,7 +130,7 @@ export default (props) => {
|
|
|
131
130
|
textDecorationLine: errorOnly ? "line-through" : undefined,
|
|
132
131
|
}}
|
|
133
132
|
>
|
|
134
|
-
Error Only
|
|
133
|
+
{apis.filter(isError).length} Error(s) Only
|
|
135
134
|
</Text>
|
|
136
135
|
</TouchableOpacity>
|
|
137
136
|
)}
|
package/index.jsx
CHANGED
|
@@ -94,14 +94,14 @@ export default ({
|
|
|
94
94
|
<View style={styles.badgeContainer}>
|
|
95
95
|
{!!numPendingApiCalls && (
|
|
96
96
|
<View style={[styles.badge, { backgroundColor: "orange" }]}>
|
|
97
|
-
<Text style={{ fontSize:
|
|
97
|
+
<Text style={{ fontSize: 6, color: "white" }}>
|
|
98
98
|
{numPendingApiCalls}
|
|
99
99
|
</Text>
|
|
100
100
|
</View>
|
|
101
101
|
)}
|
|
102
102
|
{!!errors && (
|
|
103
103
|
<View style={[styles.badge, { backgroundColor: "red" }]}>
|
|
104
|
-
<Text style={{ fontSize:
|
|
104
|
+
<Text style={{ fontSize: 6, color: "white" }}>{errors}</Text>
|
|
105
105
|
</View>
|
|
106
106
|
)}
|
|
107
107
|
</View>
|
|
@@ -185,7 +185,7 @@ const styles = StyleSheet.create({
|
|
|
185
185
|
zIndex: 999,
|
|
186
186
|
},
|
|
187
187
|
badge: {
|
|
188
|
-
padding:
|
|
188
|
+
padding: 3,
|
|
189
189
|
borderRadius: 999,
|
|
190
190
|
},
|
|
191
191
|
close: {
|