fix(delete my account): must check if any TPA providers are connected (#60)

This commit is contained in:
albemarle
2019-05-22 11:05:44 -04:00
committed by GitHub
parent 27cc4fe692
commit b81f7ae8b9
3 changed files with 8 additions and 1 deletions

5
package-lock.json generated
View File

@@ -12306,6 +12306,11 @@
"resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz",
"integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c="
},
"lodash.findindex": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.findindex/-/lodash.findindex-4.6.0.tgz",
"integrity": "sha1-oyRd7mH7m24GJLU1ElYku2nBEQY="
},
"lodash.flattendeep": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",

View File

@@ -49,6 +49,7 @@
"i18n-iso-countries": "^3.7.8",
"iso-countries-languages": "^0.2.1",
"lodash.camelcase": "^4.3.0",
"lodash.findindex": "^4.6.0",
"lodash.get": "^4.4.2",
"lodash.isempty": "^4.4.0",
"lodash.omit": "^4.5.0",

View File

@@ -2,6 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import memoize from 'memoize-one';
import findIndex from 'lodash.findindex';
import {
injectIntl,
intlShape,
@@ -153,7 +154,7 @@ class AccountSettingsPage extends React.Component {
this.props.countryTimeZoneOptions,
);
const hasLinkedTPA = this.props.tpaProviders && this.props.tpaProviders.length > 0;
const hasLinkedTPA = findIndex(this.props.tpaProviders, provider => provider.connected) >= 0;
return (
<React.Fragment>