-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
53 lines (47 loc) · 1.42 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
import { AppRegistry } from 'react-native';
import App from './App/App';
import config from './App/config';
import userStore from 'App/Stores/User';
import locationStore from 'App/Stores/Location';
import spotFilterStore from 'App/Stores/SpotFilters';
import codePushStore from 'App/Stores/CodePush';
import logStore, { Level } from 'App/Stores/Log';
import * as Sentry from '@sentry/react-native';
if (config.sentryDSN) {
Sentry.init({
dsn: config.sentryDSN,
enableNative: false,
enableNativeCrashHandling: false,
enableNativeNagger: false,
attachStacktrace: true
});
if (!__DEV__) {
const mapper = {
[Level.DEBUG]: Sentry.Severity.Debug,
[Level.INFO]: Sentry.Severity.Info,
[Level.WARN]: Sentry.Severity.Warning,
[Level.ERROR]: Sentry.Severity.Error,
}
const sentryHandler = (entry) => {
Sentry.captureMessage(entry.message, mapper[entry.level])
}
logStore.handlers.push(sentryHandler)
}
}
if (__DEV__) {
// @ts-ignore
global.stores = window.stores = {
user: userStore,
location: locationStore,
spotFilters: spotFilterStore,
codePush: codePushStore,
log: logStore,
}
}
// https://github.com/apollographql/apollo-client/issues/3236
Object.setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
// eslint-disable-next-line no-proto
obj.__proto__ = proto;
return obj;
};
AppRegistry.registerComponent('SportySpots', () => App);