Merge branch 'fix-crash-670' into 'develop'
Check URL params defensively, probably fixes #670 Closes #670 See merge request soapbox-pub/soapbox-fe!575
This commit is contained in:
commit
a67609021b
7 changed files with 14 additions and 7 deletions
|
@ -18,7 +18,8 @@ import { openModal } from 'soapbox/actions/modal';
|
|||
import { NavLink } from 'react-router-dom';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
const mapStateToProps = (state, { params: { username }, withReplies = false }) => {
|
||||
const mapStateToProps = (state, { params, withReplies = false }) => {
|
||||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const accounts = state.getIn(['accounts']);
|
||||
const accountFetchError = (state.getIn(['accounts', -1, 'username'], '').toLowerCase() === username.toLowerCase());
|
||||
|
|
|
@ -18,7 +18,8 @@ import { getSoapboxConfig } from 'soapbox/actions/soapbox';
|
|||
|
||||
const emptyList = ImmutableList();
|
||||
|
||||
const mapStateToProps = (state, { params: { username }, withReplies = false }) => {
|
||||
const mapStateToProps = (state, { params, withReplies = false }) => {
|
||||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const accounts = state.getIn(['accounts']);
|
||||
const accountFetchError = (state.getIn(['accounts', -1, 'username'], '').toLowerCase() === username.toLowerCase());
|
||||
|
|
|
@ -10,7 +10,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
|||
import { debounce } from 'lodash';
|
||||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
|
||||
const mapStateToProps = (state, { params: { username } }) => {
|
||||
const mapStateToProps = (state, { params }) => {
|
||||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const meUsername = state.getIn(['accounts', me, 'username']);
|
||||
return {
|
||||
|
|
|
@ -18,7 +18,8 @@ import ScrollableList from '../../components/scrollable_list';
|
|||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
import { getFollowDifference } from 'soapbox/utils/accounts';
|
||||
|
||||
const mapStateToProps = (state, { params: { username }, withReplies = false }) => {
|
||||
const mapStateToProps = (state, { params, withReplies = false }) => {
|
||||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const accounts = state.getIn(['accounts']);
|
||||
const accountFetchError = (state.getIn(['accounts', -1, 'username'], '').toLowerCase() === username.toLowerCase());
|
||||
|
|
|
@ -18,7 +18,8 @@ import ScrollableList from '../../components/scrollable_list';
|
|||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
import { getFollowDifference } from 'soapbox/utils/accounts';
|
||||
|
||||
const mapStateToProps = (state, { params: { username }, withReplies = false }) => {
|
||||
const mapStateToProps = (state, { params, withReplies = false }) => {
|
||||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const accounts = state.getIn(['accounts']);
|
||||
const accountFetchError = (state.getIn(['accounts', -1, 'username'], '').toLowerCase() === username.toLowerCase());
|
||||
|
|
|
@ -9,7 +9,8 @@ import { injectIntl, FormattedMessage } from 'react-intl';
|
|||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import MissingIndicator from 'soapbox/components/missing_indicator';
|
||||
|
||||
const mapStateToProps = (state, { params: { username } }) => {
|
||||
const mapStateToProps = (state, { params }) => {
|
||||
const username = params.username || '';
|
||||
const me = state.get('me');
|
||||
const meUsername = state.getIn(['accounts', me, 'username']);
|
||||
return {
|
||||
|
|
|
@ -16,7 +16,8 @@ import { getFeatures } from 'soapbox/utils/features';
|
|||
import { makeGetAccount } from '../selectors';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
|
||||
const mapStateToProps = (state, { params: { username }, withReplies = false }) => {
|
||||
const mapStateToProps = (state, { params, withReplies = false }) => {
|
||||
const username = params.username || '';
|
||||
const accounts = state.getIn(['accounts']);
|
||||
const accountFetchError = (state.getIn(['accounts', -1, 'username'], '').toLowerCase() === username.toLowerCase());
|
||||
const getAccount = makeGetAccount();
|
||||
|
|
Loading…
Reference in a new issue