forked from XRPL-Labs/Xaman-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.ts
28 lines (24 loc) · 759 Bytes
/
debug.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* eslint-disable */
import { LogBox } from 'react-native';
if (__DEV__) {
// disable some yellow boxes
const IGNORED_WARNINGS = [
'Remote debugger is in a background tab which may cause apps to perform slowly',
'Require cycle:',
'Setting a timer',
'Module AppRegistry is not',
'Warning: Failed prop type',
];
const oldConsoleWarn = console.warn;
console.warn = (...args) => {
if (
typeof args[0] === 'string' &&
IGNORED_WARNINGS.some((ignoredWarning) => args[0].startsWith(ignoredWarning))
) {
return;
}
return oldConsoleWarn.apply(console, args);
};
LogBox.ignoreLogs(IGNORED_WARNINGS);
LogBox.ignoreAllLogs();
}