Skip to content

Commit

Permalink
Remove error message in favor of redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Michurin committed Mar 8, 2017
1 parent 64f7b40 commit 23ddb79
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions client/signup/steps/site-or-domain/index.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* External dependencies
*/
import page from 'page';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { localize } from 'i18n-calypso';
import { defer } from 'lodash';

/**
* Internal dependencies
Expand All @@ -18,10 +14,9 @@ import Card from 'components/card';
// TODO: `design-type-with-store`, `design-type`, and this component could be refactored to reduce redundancy
import DomainImage from 'signup/steps/design-type-with-store/domain-image';
import PageImage from 'signup/steps/design-type-with-store/page-image';
import { getStepUrl } from 'signup/utils';
import { createNotice } from 'state/notices/actions';
import { externalRedirect } from 'lib/route/path';

class SiteOrDomain extends Component {
export default class SiteOrDomain extends Component {
componentWillMount() {
const { queryObject } = this.props;
let isValidDomain = queryObject && queryObject.new;
Expand All @@ -38,18 +33,9 @@ class SiteOrDomain extends Component {
}

if ( ! isValidDomain ) {
page( getStepUrl( 'main' ) );
defer( () => {
this.props.createNotice( 'is-error',
queryObject && queryObject.new
? this.props.translate( "Unsupported domain name '%(domainName)s', you'll be able to choose domain later", {
args: {
domainName: queryObject.new
}
} )
: this.props.translate( "You haven't provided a domain name, you'll be able to choose domain later" )
);
} );
// /domains domain search is an external application to calypso,
// therefor a full redirect required:
externalRedirect( '/domains' );
}
}

Expand Down Expand Up @@ -132,5 +118,3 @@ class SiteOrDomain extends Component {
);
}
}

export default connect( null, { createNotice } )( localize( SiteOrDomain ) );

0 comments on commit 23ddb79

Please sign in to comment.