-
Notifications
You must be signed in to change notification settings - Fork 36
/
index.js
76 lines (64 loc) · 2.26 KB
/
index.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import 'node-libs-react-native/globals';
import '@ethersproject/shims';
import '@walletconnect/react-native-compat';
import {AppRegistry, I18nManager, LogBox} from 'react-native';
import './global';
import './src/modifiers/json-rpc-provider.modifier';
import {DEBUG_VARS} from '@app/debug-vars';
import {enableBatchedStateUpdates} from '@app/hooks/batched-set-state';
import {IS_IOS, RTL_LANGUAGES} from '@app/variables/common';
import messaging from '@react-native-firebase/messaging';
import * as Sentry from '@sentry/react-native';
import Config from 'react-native-config';
import {enableFreeze, enableScreens} from 'react-native-screens';
import {name as appName} from './app.json';
import {App} from './src/app';
import './src/event-actions';
import {Jailbreak} from './src/jailbreak';
import {Language} from '@app/models/language';
import {configurePersistable} from 'mobx-persist-store';
import {storage} from '@app/services/mmkv';
configurePersistable({storage});
LogBox.ignoreAllLogs();
if (!global.BigInt) {
const BigInt = require('big-integer');
Object.assign(global, {
BigInt: BigInt,
});
}
const isRTL = RTL_LANGUAGES.includes(Language.current);
I18nManager.allowRTL(isRTL);
enableScreens();
enableFreeze(true);
enableBatchedStateUpdates();
LogBox.ignoreLogs(["The 'navigation' object hasn't been initialized"]);
if (__DEV__ && IS_IOS) {
messaging().setAPNSToken('dev-apns-token', 'sandbox');
}
if (Config.SENTRY_DSN && DEBUG_VARS.enableSentry) {
try {
Sentry.init({
dsn: Config.SENTRY_DSN,
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
tracesSampleRate: 1.0,
environment: Config.ENVIRONMENT ?? 'development',
enableWatchdogTerminationTracking: false,
attachScreenshot: true,
attachStacktrace: true,
beforeSend(event, hint) {
if (event.level !== 'fatal') {
delete hint.attachments;
}
return event;
},
});
} catch (e) {
console.log('sentry init failed');
}
}
const Wrapped = DEBUG_VARS.enableSentry ? Sentry.wrap(App) : App;
AppRegistry.registerComponent(appName, () => Wrapped);
AppRegistry.registerComponent('jailbreak', () =>
Config.FOR_DETOX ? Wrapped : Jailbreak,
);