diff --git a/webapp/components/login_email.jsx b/webapp/components/login_email.jsx
index e30b66fa36..d54c32ff9c 100644
--- a/webapp/components/login_email.jsx
+++ b/webapp/components/login_email.jsx
@@ -79,7 +79,7 @@ class LoginEmail extends React.Component {
},
(err) => {
if (err.id === 'api.user.login.not_verified.app_error') {
- window.location.href = '/verify_email?teamname=' + encodeURIComponent(name) + '&email=' + encodeURIComponent(email);
+ browserHistory.push('/verify_email?teamname=' + encodeURIComponent(name) + '&email=' + encodeURIComponent(email));
return;
}
state.serverError = err.message;
diff --git a/webapp/components/login_ldap.jsx b/webapp/components/login_ldap.jsx
index b9997dec44..59ff973dc6 100644
--- a/webapp/components/login_ldap.jsx
+++ b/webapp/components/login_ldap.jsx
@@ -5,6 +5,7 @@ import * as Utils from 'utils/utils.jsx';
import * as Client from 'utils/client.jsx';
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
+import {browserHistory} from 'react-router';
const holders = defineMessages({
badTeam: {
@@ -74,9 +75,9 @@ class LoginLdap extends React.Component {
() => {
const redirect = Utils.getUrlParameter('redirect');
if (redirect) {
- window.location.href = decodeURIComponent(redirect);
+ browserHistory.push(decodeURIComponent(redirect));
} else {
- window.location.href = '/' + teamName + '/channels/town-square';
+ browserHistory.push('/' + teamName + '/channels/town-square');
}
},
(err) => {
@@ -141,4 +142,4 @@ LoginLdap.propTypes = {
teamName: React.PropTypes.string.isRequired
};
-export default injectIntl(LoginLdap);
\ No newline at end of file
+export default injectIntl(LoginLdap);
diff --git a/webapp/components/login_username.jsx b/webapp/components/login_username.jsx
index 5fa27f2d58..71874fa1a7 100644
--- a/webapp/components/login_username.jsx
+++ b/webapp/components/login_username.jsx
@@ -6,6 +6,7 @@ import * as Client from 'utils/client.jsx';
import UserStore from 'stores/user_store.jsx';
import {injectIntl, intlShape, defineMessages, FormattedMessage} from 'react-intl';
+import {browserHistory} from 'react-router';
var holders = defineMessages({
badTeam: {
@@ -85,9 +86,9 @@ export default class LoginUsername extends React.Component {
const redirect = Utils.getUrlParameter('redirect');
if (redirect) {
- window.location.href = decodeURIComponent(redirect);
+ browserHistory.push(decodeURIComponent(redirect));
} else {
- window.location.href = '/' + name + '/channels/town-square';
+ browserHistory.push('/' + name + '/channels/town-square');
}
},
(err) => {
diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx
index 520f05ed09..e58e142d02 100644
--- a/webapp/components/navbar.jsx
+++ b/webapp/components/navbar.jsx
@@ -30,6 +30,8 @@ import {FormattedMessage} from 'react-intl';
import {Popover, OverlayTrigger} from 'react-bootstrap';
+import {Link, browserHistory} from 'react-router';
+
import React from 'react';
export default class Navbar extends React.Component {
@@ -81,7 +83,7 @@ export default class Navbar extends React.Component {
Client.leaveChannel(this.state.channel.id,
() => {
AsyncClient.getChannels(true);
- window.location.href = TeamStore.getCurrentTeamUrl() + '/channels/town-square';
+ browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/town-square');
},
(err) => {
AsyncClient.dispatchError(err, 'handleLeave');
@@ -349,12 +351,12 @@ export default class Navbar extends React.Component {
return (
);
}
diff --git a/webapp/components/navbar_dropdown.jsx b/webapp/components/navbar_dropdown.jsx
index 9038522ac4..7e42a71ea8 100644
--- a/webapp/components/navbar_dropdown.jsx
+++ b/webapp/components/navbar_dropdown.jsx
@@ -128,14 +128,14 @@ export default class NavbarDropdown extends React.Component {
if (isSystemAdmin) {
sysAdminLink = (
-
-
+
);
}
@@ -145,16 +145,16 @@ export default class NavbarDropdown extends React.Component {
if (global.window.mm_config.EnableTeamCreation === 'true') {
teams.push(
-
-
+
);
}
@@ -163,15 +163,15 @@ export default class NavbarDropdown extends React.Component {
if (global.window.mm_config.HelpLink) {
helpLink = (
-
-
+
);
}
@@ -180,15 +180,15 @@ export default class NavbarDropdown extends React.Component {
if (global.window.mm_config.ReportAProblemLink) {
reportLink = (
-
-
+
);
}
diff --git a/webapp/components/not_logged_in.jsx b/webapp/components/not_logged_in.jsx
index ac359056a5..4beee6259b 100644
--- a/webapp/components/not_logged_in.jsx
+++ b/webapp/components/not_logged_in.jsx
@@ -5,6 +5,7 @@ import $ from 'jquery';
import {FormattedMessage} from 'react-intl';
import React from 'react';
+import {Link} from 'react-router';
export default class NotLoggedIn extends React.Component {
componentDidMount() {
@@ -29,34 +30,34 @@ export default class NotLoggedIn extends React.Component {