<commit_before>/* @flow */
import { NativeModules } from 'react-native';
import DeviceInfo from 'react-native-device-info';

import type { Narrow, Notification } from './types';

const isDevelopment = process.env.NODE_ENV === 'development';
const isEmulator = NativeModules.RNDeviceInfo ? DeviceInfo.isEmulator() : false;

type Config = {
  startup: {
    narrow: ?Narrow,
    anchor: number,
    notification: ?Notification,
  },
  compatibilityUrl: string,
  messagesPerRequest: number,
  scrollCallbackThrottle: number,
  messageListThreshold: number,
  enableReduxLogging: boolean,
  enableReduxSlowReducerWarnings: boolean,
  enableSentry: boolean,
  enableWebViewErrorDisplay: boolean,
  enableNotifications: boolean,
  slowReducersThreshold: number,
  sentryKey: string,
  enableErrorConsoleLogging: boolean,
  trackServerEvents: string[],
  serverDataOnStartup: string[],
};

const config: Config = {
  startup: {
    narrow: undefined,
    anchor: 0,
    notification: undefined,
  },
  compatibilityUrl: 'https://zulipchat.com/compatibility',
  messagesPerRequest: 50,
  scrollCallbackThrottle: 250,
  messageListThreshold: 250,
  enableReduxLogging: isDevelopment && !!global.btoa,
  enableReduxSlowReducerWarnings: isDevelopment && !!global.btoa,
  enableSentry: !isDevelopment && !isEmulator,
  enableWebViewErrorDisplay: false,
  enableNotifications: !isEmulator,
  slowReducersThreshold: 5,
  sentryKey: 'ADD-DSN-HERE',
  enableErrorConsoleLogging: true,
  trackServerEvents: [
    // 'custom_profile_fields', // ???<commit_msg>webview: Use the detailed red error banners just in development.<commit_after>/* @flow */
import { NativeModules } from 'react-native';
import DeviceInfo from 'react-native-device-info';

import type { Narrow, Notification } from './types';

const isDevelopment = process.env.NODE_ENV === 'development';
const isEmulator = NativeModules.RNDeviceInfo ? DeviceInfo.isEmulator() : false;

type Config = {
  startup: {
    narrow: ?Narrow,
    anchor: number,
    notification: ?Notification,
  },
  compatibilityUrl: string,
  messagesPerRequest: number,
  scrollCallbackThrottle: number,
  messageListThreshold: number,
  enableReduxLogging: boolean,
  enableReduxSlowReducerWarnings: boolean,
  enableSentry: boolean,
  enableWebViewErrorDisplay: boolean,
  enableNotifications: boolean,
  slowReducersThreshold: number,
  sentryKey: string,
  enableErrorConsoleLogging: boolean,
  trackServerEvents: string[],
  serverDataOnStartup: string[],
};

const config: Config = {
  startup: {
    narrow: undefined,
    anchor: 0,
    notification: undefined,
  },
  compatibilityUrl: 'https://zulipchat.com/compatibility',
  messagesPerRequest: 50,
  scrollCallbackThrottle: 250,
  messageListThreshold: 250,
  enableReduxLogging: isDevelopment && !!global.btoa,
  enableReduxSlowReducerWarnings: isDevelopment && !!global.btoa,
  enableSentry: !isDevelopment && !isEmulator,
  enableWebViewErrorDisplay: isDevelopment,
  enableNotifications: !isEmulator,
  slowReducersThreshold: 5,
  sentryKey: 'ADD-DSN-HERE',
  enableErrorConsoleLogging: true,
  trackServerEvents: [
    // 'custom_profile_fields', // ???
{'fraction_non_alphanumeric': 0.10747217806041336, 'fraction_numerical': 0.006359300476947536, 'mean_word_length': 5.304609218436874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '451870', 'n_tokens_mistral': 999, 'n_tokens_neox': 971, 'n_words': 211}