Skip to content

Commit

Permalink
site: should remove locale info when switch to old site, close: ant-d…
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed Dec 13, 2016
1 parent 7cf4192 commit f0d1b94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion site/theme/template/Layout/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import { Select, Modal } from 'antd';
import { version as antdVersion } from 'antd/package.json';
import * as utils from '../utils';
import { docVersions } from '../../';

const Option = Select.Option;
Expand Down Expand Up @@ -63,7 +64,10 @@ class Footer extends React.Component {
}

handleVersionChange = (url) => {
window.location.href = window.location.href.replace(window.location.origin, url);
const currentUrl = window.location.href;
const currentPathname = window.location.pathname;
window.location.href = currentUrl.replace(window.location.origin, url)
.replace(currentPathname, utils.getLocalizedPathname(currentPathname));
}

render() {
Expand Down

0 comments on commit f0d1b94

Please sign in to comment.