[MM-59061] Remove redundant index route for Root.tsx (#27441)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
817e18414e
Коммит
47dcb02ae0
@@ -4,12 +4,11 @@
|
||||
import React from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
import {Provider} from 'react-redux';
|
||||
import {Router, Route} from 'react-router-dom';
|
||||
import {Router} from 'react-router-dom';
|
||||
|
||||
import store from 'stores/redux_store';
|
||||
|
||||
import {makeAsyncComponent} from 'components/async_load';
|
||||
import CRTPostsChannelResetWatcher from 'components/threading/channel_threads/posts_channel_reset_watcher';
|
||||
|
||||
import {getHistory} from 'utils/browser_history';
|
||||
const LazyRoot = React.lazy(() => import('components/root'));
|
||||
@@ -19,12 +18,8 @@ const Root = makeAsyncComponent('Root', LazyRoot);
|
||||
const App = () => {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<CRTPostsChannelResetWatcher/>
|
||||
<Router history={getHistory()}>
|
||||
<Route
|
||||
path='/'
|
||||
component={Root}
|
||||
/>
|
||||
<Root/>
|
||||
</Router>
|
||||
</Provider>
|
||||
);
|
||||
|
||||
@@ -9,6 +9,7 @@ import * as actions from 'actions/status_actions';
|
||||
|
||||
import mockStore from 'tests/test_store';
|
||||
import Constants from 'utils/constants';
|
||||
import {TestHelper} from 'utils/test_helper';
|
||||
|
||||
import type {GlobalState} from 'types/store';
|
||||
|
||||
@@ -41,6 +42,9 @@ describe('ChannelController', () => {
|
||||
EnableUserStatuses: 'false',
|
||||
},
|
||||
},
|
||||
preferences: {
|
||||
myPreferences: TestHelper.getPreferencesMock(),
|
||||
},
|
||||
},
|
||||
} as unknown as GlobalState;
|
||||
jest.useFakeTimers();
|
||||
|
||||
@@ -15,6 +15,7 @@ import LoadingScreen from 'components/loading_screen';
|
||||
import ProductNoticesModal from 'components/product_notices_modal';
|
||||
import ResetStatusModal from 'components/reset_status_modal';
|
||||
import Sidebar from 'components/sidebar';
|
||||
import CRTPostsChannelResetWatcher from 'components/threading/channel_threads/posts_channel_reset_watcher';
|
||||
import UnreadsStatusHandler from 'components/unreads_status_handler';
|
||||
|
||||
import Pluggable from 'plugins/pluggable';
|
||||
@@ -63,6 +64,7 @@ export default function ChannelController(props: Props) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<CRTPostsChannelResetWatcher/>
|
||||
<Sidebar/>
|
||||
<div
|
||||
id='channel_view'
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {connect} from 'react-redux';
|
||||
import {withRouter} from 'react-router-dom';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import type {Dispatch} from 'redux';
|
||||
|
||||
@@ -78,4 +79,4 @@ function mapDispatchToProps(dispatch: Dispatch) {
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Root);
|
||||
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(Root));
|
||||
|
||||
Ссылка в новой задаче
Block a user