forked from zulip/zulip-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
63 lines (58 loc) · 1.66 KB
/
config.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
/* @flow strict-local */
import { NativeModules } from 'react-native';
import DeviceInfo from 'react-native-device-info';
import type { Narrow, Notification } from './types';
import { FIRST_UNREAD_ANCHOR } from './constants';
const isDevelopment = process.env.NODE_ENV === 'development';
const isEmulator = NativeModules.RNDeviceInfo ? DeviceInfo.isEmulator() : false;
type Config = {|
startup: {
narrow: ?Narrow,
anchor: number,
notification: ?Notification,
},
messagesPerRequest: number,
scrollCallbackThrottle: number,
messageListThreshold: number,
enableReduxLogging: boolean,
enableReduxSlowReducerWarnings: boolean,
enableSentry: boolean,
enableWebViewErrorDisplay: boolean,
slowReducersThreshold: number,
sentryKey: string,
enableErrorConsoleLogging: boolean,
serverDataOnStartup: string[],
|};
const config: Config = {
startup: {
narrow: undefined,
anchor: FIRST_UNREAD_ANCHOR,
notification: undefined,
},
messagesPerRequest: 50,
scrollCallbackThrottle: 250,
messageListThreshold: 250,
enableReduxLogging: isDevelopment && !!global.btoa,
enableReduxSlowReducerWarnings: isDevelopment && !!global.btoa,
enableSentry: !isDevelopment && !isEmulator,
enableWebViewErrorDisplay: isDevelopment,
slowReducersThreshold: 5,
sentryKey: 'ADD-DSN-HERE',
enableErrorConsoleLogging: true,
serverDataOnStartup: [
'alert_words',
'message',
'muted_topics',
'presence',
'realm',
'realm_emoji',
'realm_filters',
'realm_user',
'realm_user_groups',
'subscription',
'update_display_settings',
'update_global_notifications',
'update_message_flags',
],
};
export default config;