react-native-in-app-debugger 1.0.16 → 1.0.18
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
|
@@ -57,13 +57,13 @@ export default ({
|
|
|
57
57
|
|
|
58
58
|
const errors = apis.filter((a) => a.response?.error).length;
|
|
59
59
|
const numPendingApiCalls = apis.filter((a) => !a.response).length;
|
|
60
|
-
let badgeHeight =
|
|
60
|
+
let badgeHeight = 20;
|
|
61
61
|
if (variables?.GIT_BRANCH) badgeHeight += 7;
|
|
62
62
|
if (variables?.BUILD_DATE_TIME) badgeHeight += 7;
|
|
63
63
|
const hasEnvOrVersion = !!env || !!version;
|
|
64
64
|
if (hasEnvOrVersion) badgeHeight += 7;
|
|
65
65
|
if (DeviceInfo) badgeHeight += 7;
|
|
66
|
-
if (badgeHeight ===
|
|
66
|
+
if (badgeHeight === 20) badgeHeight += 7;
|
|
67
67
|
labels.forEach(() => (badgeHeight += 7));
|
|
68
68
|
|
|
69
69
|
const {
|
|
@@ -90,7 +90,7 @@ export default ({
|
|
|
90
90
|
{...(isOpen ? {} : panResponder.panHandlers)}
|
|
91
91
|
>
|
|
92
92
|
{!isOpen ? (
|
|
93
|
-
<TouchableOpacity onPress={() => setIsOpen(true)} style={styles.box}>
|
|
93
|
+
<TouchableOpacity onPress={() => setIsOpen(true)} style={styles.box} activeOpacity={.8}>
|
|
94
94
|
<View style={styles.badgeContainer}>
|
|
95
95
|
{!!numPendingApiCalls && (
|
|
96
96
|
<View style={[styles.badge, { backgroundColor: "orange" }]}>
|