You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SettingsView.tsx 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. import _ from 'lodash';
  2. import React, { Component } from 'react';
  3. import { WithTranslation } from 'react-i18next';
  4. import {
  5. Alert,
  6. Linking,
  7. NativeModules,
  8. Platform,
  9. ScrollView,
  10. Text,
  11. View,
  12. ViewStyle
  13. } from 'react-native';
  14. import { Divider } from 'react-native-paper';
  15. import { connect } from 'react-redux';
  16. import { getDefaultURL } from '../../../app/functions.native';
  17. import { IReduxState, IStore } from '../../../app/types';
  18. import Avatar from '../../../base/avatar/components/Avatar';
  19. import { getLegalUrls } from '../../../base/config/functions.native';
  20. import { translate } from '../../../base/i18n/functions';
  21. import JitsiScreen from '../../../base/modal/components/JitsiScreen';
  22. import { getLocalParticipant } from '../../../base/participants/functions';
  23. import { updateSettings } from '../../../base/settings/actions';
  24. import Button from '../../../base/ui/components/native/Button';
  25. import Input from '../../../base/ui/components/native/Input';
  26. import Switch from '../../../base/ui/components/native/Switch';
  27. import { BUTTON_TYPES } from '../../../base/ui/constants.any';
  28. import { AVATAR_SIZE } from '../../../welcome/components/styles';
  29. import { isServerURLChangeEnabled, normalizeUserInputURL } from '../../functions.native';
  30. import FormRow from './FormRow';
  31. import FormSection from './FormSection';
  32. import styles from './styles';
  33. /**
  34. * Application information module.
  35. */
  36. const { AppInfo } = NativeModules;
  37. interface IState {
  38. /**
  39. * State variable for the disable call integration switch.
  40. */
  41. disableCallIntegration?: boolean;
  42. /**
  43. * State variable for the disable crash reporting switch.
  44. */
  45. disableCrashReporting?: boolean;
  46. /**
  47. * State variable for the disable p2p switch.
  48. */
  49. disableP2P?: boolean;
  50. /**
  51. * Whether the self view is disabled or not.
  52. */
  53. disableSelfView?: boolean;
  54. /**
  55. * State variable for the display name field.
  56. */
  57. displayName?: string;
  58. /**
  59. * State variable for the email field.
  60. */
  61. email?: string;
  62. /**
  63. * State variable for the server URL field.
  64. */
  65. serverURL?: string;
  66. /**
  67. * State variable for start car mode.
  68. */
  69. startCarMode?: boolean;
  70. /**
  71. * State variable for the start with audio muted switch.
  72. */
  73. startWithAudioMuted?: boolean;
  74. /**
  75. * State variable for the start with video muted switch.
  76. */
  77. startWithVideoMuted?: boolean;
  78. }
  79. /**
  80. * The type of the React {@code Component} props of
  81. * {@link SettingsView}.
  82. */
  83. interface IProps extends WithTranslation {
  84. /**
  85. * The legal URL's.
  86. */
  87. _legalUrls: {
  88. helpCentre: string;
  89. privacy: string;
  90. terms: string;
  91. };
  92. /**
  93. * The ID of the local participant.
  94. */
  95. _localParticipantId?: string;
  96. /**
  97. * The default URL for when there is no custom URL set in the settings.
  98. *
  99. * @protected
  100. */
  101. _serverURL: string;
  102. /**
  103. * Flag indicating if URL can be changed by user.
  104. *
  105. * @protected
  106. */
  107. _serverURLChangeEnabled: boolean;
  108. /**
  109. * The current settings object.
  110. */
  111. _settings: {
  112. disableCallIntegration?: boolean;
  113. disableCrashReporting?: boolean;
  114. disableP2P?: boolean;
  115. disableSelfView?: boolean;
  116. displayName?: string;
  117. email?: string;
  118. serverURL?: string;
  119. startCarMode?: boolean;
  120. startWithAudioMuted?: boolean;
  121. startWithVideoMuted?: boolean;
  122. };
  123. /**
  124. * Whether {@link SettingsView} is visible.
  125. *
  126. * @protected
  127. */
  128. _visible?: boolean;
  129. /**
  130. * Add bottom padding to the screen.
  131. */
  132. addBottomInset?: boolean;
  133. /**
  134. * Redux store dispatch function.
  135. */
  136. dispatch: IStore['dispatch'];
  137. /**
  138. * Default prop for navigating between screen components(React Navigation).
  139. */
  140. navigation?: Object;
  141. /**
  142. * Bounce when scrolling.
  143. */
  144. scrollBounces?: boolean;
  145. }
  146. /**
  147. * The native container rendering the app settings page.
  148. */
  149. class SettingsView extends Component<IProps, IState> {
  150. _urlField: Object;
  151. /**
  152. *
  153. * Initializes a new {@code SettingsView} instance.
  154. *
  155. * @inheritdoc
  156. */
  157. constructor(props: IProps) {
  158. super(props);
  159. const {
  160. disableCallIntegration,
  161. disableCrashReporting,
  162. disableP2P,
  163. disableSelfView,
  164. displayName,
  165. email,
  166. serverURL,
  167. startCarMode,
  168. startWithAudioMuted,
  169. startWithVideoMuted
  170. } = props._settings || {};
  171. this.state = {
  172. disableCallIntegration,
  173. disableCrashReporting,
  174. disableP2P,
  175. disableSelfView,
  176. displayName: displayName || '',
  177. email: email || '',
  178. serverURL: serverURL || '',
  179. startCarMode,
  180. startWithAudioMuted,
  181. startWithVideoMuted
  182. };
  183. // Bind event handlers so they are only bound once per instance.
  184. this._onBlurServerURL = this._onBlurServerURL.bind(this);
  185. this._onChangeDisplayName = this._onChangeDisplayName.bind(this);
  186. this._onChangeEmail = this._onChangeEmail.bind(this);
  187. this._onChangeServerURL = this._onChangeServerURL.bind(this);
  188. this._onClose = this._onClose.bind(this);
  189. this._onDisableCallIntegration = this._onDisableCallIntegration.bind(this);
  190. this._onDisableCrashReporting = this._onDisableCrashReporting.bind(this);
  191. this._onDisableP2P = this._onDisableP2P.bind(this);
  192. this._onDisableSelfView = this._onDisableSelfView.bind(this);
  193. this._onStartAudioMutedChange
  194. = this._onStartAudioMutedChange.bind(this);
  195. this._onStartCarmodeInLowBandwidthMode
  196. = this._onStartCarmodeInLowBandwidthMode.bind(this);
  197. this._onStartVideoMutedChange
  198. = this._onStartVideoMutedChange.bind(this);
  199. this._setURLFieldReference = this._setURLFieldReference.bind(this);
  200. this._onShowHelpPressed = this._onShowHelpPressed.bind(this);
  201. this._onShowPrivacyPressed = this._onShowPrivacyPressed.bind(this);
  202. this._onShowTermsPressed = this._onShowTermsPressed.bind(this);
  203. this._showURLAlert = this._showURLAlert.bind(this);
  204. }
  205. /**
  206. * Updates and syncs settings.
  207. *
  208. * @inheritdoc
  209. * @returns {void}
  210. */
  211. componentDidUpdate(prevProps: IProps) {
  212. const { _settings } = this.props;
  213. if (!_.isEqual(prevProps._settings, _settings)) {
  214. // @ts-ignore
  215. // eslint-disable-next-line react/no-did-update-set-state
  216. this.setState(_settings);
  217. }
  218. }
  219. /**
  220. * Implements React's {@link Component#render()}, renders the settings page.
  221. *
  222. * @inheritdoc
  223. * @returns {ReactElement}
  224. */
  225. render() {
  226. const {
  227. disableCallIntegration,
  228. disableCrashReporting,
  229. disableP2P,
  230. disableSelfView,
  231. displayName,
  232. email,
  233. serverURL,
  234. startCarMode,
  235. startWithAudioMuted,
  236. startWithVideoMuted
  237. } = this.state;
  238. const {
  239. addBottomInset = false,
  240. scrollBounces = false,
  241. t
  242. } = this.props;
  243. return (
  244. <JitsiScreen
  245. disableForcedKeyboardDismiss = { true }
  246. // @ts-ignore
  247. safeAreaInsets = { [ addBottomInset && 'bottom', 'left', 'right' ].filter(Boolean) }
  248. style = { styles.settingsViewContainer }>
  249. <ScrollView bounces = { scrollBounces }>
  250. <View style = { styles.avatarContainer as ViewStyle }>
  251. <Avatar
  252. participantId = { this.props._localParticipantId }
  253. size = { AVATAR_SIZE } />
  254. </View>
  255. <FormSection
  256. label = 'settingsView.profileSection'>
  257. <Input
  258. customStyles = {{ container: styles.customContainer }}
  259. label = { t('settingsView.displayName') }
  260. onChange = { this._onChangeDisplayName }
  261. placeholder = { t('settingsView.displayNamePlaceholderText') }
  262. textContentType = { 'name' } // iOS only
  263. value = { displayName ?? '' } />
  264. {/* @ts-ignore */}
  265. <Divider style = { styles.fieldSeparator } />
  266. <Input
  267. autoCapitalize = 'none'
  268. customStyles = {{ container: styles.customContainer }}
  269. keyboardType = { 'email-address' }
  270. label = { t('settingsView.email') }
  271. onChange = { this._onChangeEmail }
  272. placeholder = { t('settingsView.emailPlaceholderText') }
  273. textContentType = { 'emailAddress' } // iOS only
  274. value = { email ?? '' } />
  275. </FormSection>
  276. <FormSection
  277. label = 'settingsView.conferenceSection'>
  278. <Input
  279. autoCapitalize = 'none'
  280. customStyles = {{ container: styles.customContainer }}
  281. editable = { this.props._serverURLChangeEnabled }
  282. keyboardType = { 'url' }
  283. label = { t('settingsView.serverURL') }
  284. onBlur = { this._onBlurServerURL }
  285. onChange = { this._onChangeServerURL }
  286. placeholder = { this.props._serverURL }
  287. textContentType = { 'URL' } // iOS only
  288. value = { serverURL ?? '' } />
  289. {/* @ts-ignore */}
  290. <Divider style = { styles.fieldSeparator } />
  291. <FormRow label = 'settingsView.startCarModeInLowBandwidthMode'>
  292. <Switch
  293. checked = { Boolean(startCarMode) }
  294. onChange = { this._onStartCarmodeInLowBandwidthMode } />
  295. </FormRow>
  296. {/* @ts-ignore */}
  297. <Divider style = { styles.fieldSeparator } />
  298. <FormRow
  299. label = 'settingsView.startWithAudioMuted'>
  300. <Switch
  301. checked = { Boolean(startWithAudioMuted) }
  302. onChange = { this._onStartAudioMutedChange } />
  303. </FormRow>
  304. {/* @ts-ignore */}
  305. <Divider style = { styles.fieldSeparator } />
  306. <FormRow label = 'settingsView.startWithVideoMuted'>
  307. <Switch
  308. checked = { Boolean(startWithVideoMuted) }
  309. onChange = { this._onStartVideoMutedChange } />
  310. </FormRow>
  311. {/* @ts-ignore */}
  312. <Divider style = { styles.fieldSeparator } />
  313. <FormRow label = 'videothumbnail.hideSelfView'>
  314. <Switch
  315. checked = { Boolean(disableSelfView) }
  316. onChange = { this._onDisableSelfView } />
  317. </FormRow>
  318. </FormSection>
  319. <FormSection
  320. label = 'settingsView.links'>
  321. <Button
  322. accessibilityLabel = 'settingsView.help'
  323. labelKey = 'settingsView.help'
  324. onClick = { this._onShowHelpPressed }
  325. style = { styles.linksButton }
  326. type = { BUTTON_TYPES.TERTIARY } />
  327. {/* @ts-ignore */}
  328. <Divider style = { styles.fieldSeparator } />
  329. <Button
  330. accessibilityLabel = 'settingsView.terms'
  331. labelKey = 'settingsView.terms'
  332. onClick = { this._onShowTermsPressed }
  333. style = { styles.linksButton }
  334. type = { BUTTON_TYPES.TERTIARY } />
  335. {/* @ts-ignore */}
  336. <Divider style = { styles.fieldSeparator } />
  337. <Button
  338. accessibilityLabel = 'settingsView.privacy'
  339. labelKey = 'settingsView.privacy'
  340. onClick = { this._onShowPrivacyPressed }
  341. style = { styles.linksButton }
  342. type = { BUTTON_TYPES.TERTIARY } />
  343. </FormSection>
  344. <FormSection
  345. label = 'settingsView.buildInfoSection'>
  346. <FormRow
  347. label = 'settingsView.version'>
  348. <Text style = { styles.text }>
  349. {`${AppInfo.version} build ${AppInfo.buildNumber}`}
  350. </Text>
  351. </FormRow>
  352. {/* @ts-ignore */}
  353. <Divider style = { styles.fieldSeparator } />
  354. <FormRow
  355. label = 'settingsView.sdkVersion'>
  356. <Text style = { styles.text }>
  357. {AppInfo.sdkVersion}
  358. </Text>
  359. </FormRow>
  360. </FormSection>
  361. <FormSection
  362. label = 'settingsView.advanced'>
  363. { Platform.OS === 'android' && (
  364. <>
  365. <FormRow
  366. label = 'settingsView.disableCallIntegration'>
  367. <Switch
  368. checked = { Boolean(disableCallIntegration) }
  369. onChange = { this._onDisableCallIntegration } />
  370. </FormRow>
  371. {/* @ts-ignore */}
  372. <Divider style = { styles.fieldSeparator } />
  373. </>
  374. )}
  375. <FormRow
  376. label = 'settingsView.disableP2P'>
  377. <Switch
  378. checked = { Boolean(disableP2P) }
  379. onChange = { this._onDisableP2P } />
  380. </FormRow>
  381. {/* @ts-ignore */}
  382. <Divider style = { styles.fieldSeparator } />
  383. {AppInfo.GOOGLE_SERVICES_ENABLED && (
  384. <FormRow
  385. fieldSeparator = { true }
  386. label = 'settingsView.disableCrashReporting'>
  387. <Switch
  388. checked = { Boolean(disableCrashReporting) }
  389. onChange = { this._onDisableCrashReporting } />
  390. </FormRow>
  391. )}
  392. </FormSection>
  393. </ScrollView>
  394. </JitsiScreen>
  395. );
  396. }
  397. /**
  398. * Handler the server URL lose focus event. Here we validate the server URL
  399. * and update it to the normalized version, or show an error if incorrect.
  400. *
  401. * @private
  402. * @returns {void}
  403. */
  404. _onBlurServerURL() {
  405. this._processServerURL(false /* hideOnSuccess */);
  406. }
  407. /**
  408. * Handles the display name field value change.
  409. *
  410. * @param {string} displayName - The value typed in the name field.
  411. * @protected
  412. * @returns {void}
  413. */
  414. _onChangeDisplayName(displayName: string) {
  415. this.setState({
  416. displayName
  417. });
  418. this._updateSettings({
  419. displayName
  420. });
  421. }
  422. /**
  423. * Handles the email field value change.
  424. *
  425. * @param {string} email - The value typed in the email field.
  426. * @protected
  427. * @returns {void}
  428. */
  429. _onChangeEmail(email: string) {
  430. this.setState({
  431. email
  432. });
  433. this._updateSettings({
  434. email
  435. });
  436. }
  437. /**
  438. * Handles the server name field value change.
  439. *
  440. * @param {string} serverURL - The server URL typed in the server field.
  441. * @protected
  442. * @returns {void}
  443. */
  444. _onChangeServerURL(serverURL: string) {
  445. this.setState({
  446. serverURL
  447. });
  448. this._updateSettings({
  449. serverURL
  450. });
  451. }
  452. /**
  453. * Handles the disable call integration change event.
  454. *
  455. * @param {boolean} disableCallIntegration - The new value
  456. * option.
  457. * @private
  458. * @returns {void}
  459. */
  460. _onDisableCallIntegration(disableCallIntegration?: boolean) {
  461. this.setState({
  462. disableCallIntegration
  463. });
  464. this._updateSettings({
  465. disableCallIntegration
  466. });
  467. }
  468. /**
  469. * Handles the disable P2P change event.
  470. *
  471. * @param {boolean} disableP2P - The new value
  472. * option.
  473. * @private
  474. * @returns {void}
  475. */
  476. _onDisableP2P(disableP2P?: boolean) {
  477. this.setState({
  478. disableP2P
  479. });
  480. this._updateSettings({
  481. disableP2P
  482. });
  483. }
  484. /** .
  485. * Handles the disable self view change event.
  486. *
  487. * @param {boolean} disableSelfView - The new value.
  488. * @private
  489. * @returns {void}
  490. */
  491. _onDisableSelfView(disableSelfView?: boolean) {
  492. this.setState({
  493. disableSelfView
  494. });
  495. this._updateSettings({
  496. disableSelfView
  497. });
  498. }
  499. /** .
  500. * Handles car mode in low bandwidth mode.
  501. *
  502. * @param {boolean} startCarMode - The new value.
  503. * @private
  504. * @returns {void}
  505. */
  506. _onStartCarmodeInLowBandwidthMode(startCarMode?: boolean) {
  507. this.setState({
  508. startCarMode
  509. });
  510. this._updateSettings({
  511. startCarMode
  512. });
  513. }
  514. /**
  515. * Handles the disable crash reporting change event.
  516. *
  517. * @param {boolean} disableCrashReporting - The new value
  518. * option.
  519. * @private
  520. * @returns {void}
  521. */
  522. _onDisableCrashReporting(disableCrashReporting?: boolean) {
  523. if (disableCrashReporting) {
  524. this._showCrashReportingDisableAlert();
  525. } else {
  526. this._disableCrashReporting(Boolean(disableCrashReporting));
  527. }
  528. }
  529. /**
  530. * Callback to be invoked on closing the modal. Also invokes normalizeUserInputURL to validate
  531. * the URL entered by the user.
  532. *
  533. * @returns {boolean} - True if the modal can be closed.
  534. */
  535. _onClose() {
  536. return this._processServerURL(true /* hideOnSuccess */);
  537. }
  538. /**
  539. * Handles the start audio muted change event.
  540. *
  541. * @param {boolean} startWithAudioMuted - The new value for the start audio muted
  542. * option.
  543. * @protected
  544. * @returns {void}
  545. */
  546. _onStartAudioMutedChange(startWithAudioMuted?: boolean) {
  547. this.setState({
  548. startWithAudioMuted
  549. });
  550. this._updateSettings({
  551. startWithAudioMuted
  552. });
  553. }
  554. /**
  555. * Handles the start video muted change event.
  556. *
  557. * @param {boolean} startWithVideoMuted - The new value for the start video muted
  558. * option.
  559. * @protected
  560. * @returns {void}
  561. */
  562. _onStartVideoMutedChange(startWithVideoMuted?: boolean) {
  563. this.setState({
  564. startWithVideoMuted
  565. });
  566. this._updateSettings({
  567. startWithVideoMuted
  568. });
  569. }
  570. /**
  571. * Processes the server URL. It normalizes it and an error alert is
  572. * displayed in case it's incorrect.
  573. *
  574. * @param {boolean} hideOnSuccess - True if the dialog should be hidden if
  575. * normalization / validation succeeds, false otherwise.
  576. * @private
  577. * @returns {void}
  578. */
  579. _processServerURL(hideOnSuccess: boolean) {
  580. // @ts-ignore
  581. const { serverURL } = this.props._settings;
  582. const normalizedURL = normalizeUserInputURL(serverURL ?? '');
  583. if (normalizedURL === null) {
  584. this._showURLAlert();
  585. return false;
  586. }
  587. this._onChangeServerURL(normalizedURL);
  588. return hideOnSuccess;
  589. }
  590. /**
  591. * Stores a reference to the URL field for later use.
  592. *
  593. * @param {Object} component - The field component.
  594. * @protected
  595. * @returns {void}
  596. */
  597. _setURLFieldReference(component: object) {
  598. this._urlField = component;
  599. }
  600. /**
  601. * Shows an alert telling the user that the URL he/she entered was invalid.
  602. *
  603. * @returns {void}
  604. */
  605. _showURLAlert() {
  606. const { t } = this.props;
  607. Alert.alert(
  608. t('settingsView.alertTitle'),
  609. t('settingsView.alertURLText'),
  610. [
  611. {
  612. // @ts-ignore
  613. onPress: () => this._urlField.focus(),
  614. text: t('settingsView.alertOk')
  615. }
  616. ]
  617. );
  618. }
  619. /**
  620. * Opens the help url into the browser.
  621. *
  622. * @returns {void}
  623. */
  624. _onShowHelpPressed() {
  625. Linking.openURL(this.props._legalUrls.helpCentre);
  626. }
  627. /**
  628. * Opens the privacy url into the browser.
  629. *
  630. * @returns {void}
  631. */
  632. _onShowPrivacyPressed() {
  633. Linking.openURL(this.props._legalUrls.privacy);
  634. }
  635. /**
  636. * Opens the terms url into the browser.
  637. *
  638. * @returns {void}
  639. */
  640. _onShowTermsPressed() {
  641. Linking.openURL(this.props._legalUrls.terms);
  642. }
  643. /**
  644. * Shows an alert warning the user about disabling crash reporting.
  645. *
  646. * @returns {void}
  647. */
  648. _showCrashReportingDisableAlert() {
  649. const { t } = this.props;
  650. Alert.alert(
  651. t('settingsView.alertTitle'),
  652. t('settingsView.disableCrashReportingWarning'),
  653. [
  654. {
  655. onPress: () => this._disableCrashReporting(true),
  656. text: t('settingsView.alertOk')
  657. },
  658. {
  659. text: t('settingsView.alertCancel')
  660. }
  661. ]
  662. );
  663. }
  664. /**
  665. * Updates the settings and sets state for disableCrashReporting.
  666. *
  667. * @param {boolean} disableCrashReporting - Whether crash reporting is disabled or not.
  668. * @returns {void}
  669. */
  670. _disableCrashReporting(disableCrashReporting: boolean) {
  671. this.setState({
  672. disableCrashReporting
  673. });
  674. this._updateSettings({
  675. disableCrashReporting
  676. });
  677. }
  678. /**
  679. * Updates the persisted settings on any change.
  680. *
  681. * @param {Object} updateObject - The partial update object for the
  682. * settings.
  683. * @private
  684. * @returns {void}
  685. */
  686. _updateSettings(updateObject: Object) {
  687. const { dispatch } = this.props;
  688. dispatch(updateSettings(updateObject));
  689. }
  690. }
  691. /**
  692. * Maps part of the Redux state to the props of this component.
  693. *
  694. * @param {Object} state - The Redux state.
  695. * @returns {IProps}
  696. */
  697. function _mapStateToProps(state: IReduxState) {
  698. const localParticipant = getLocalParticipant(state);
  699. return {
  700. _legalUrls: getLegalUrls(state),
  701. _localParticipantId: localParticipant?.id,
  702. _serverURL: getDefaultURL(state),
  703. _serverURLChangeEnabled: isServerURLChangeEnabled(state),
  704. _settings: state['features/base/settings'],
  705. _visible: state['features/settings'].visible
  706. };
  707. }
  708. export default translate(connect(_mapStateToProps)(SettingsView));