From 47dcb02ae0a6690471f04a458a33019dcd370ada Mon Sep 17 00:00:00 2001 From: M-ZubairAhmed Date: Thu, 27 Jun 2024 06:51:27 +0000 Subject: [PATCH] [MM-59061] Remove redundant index route for Root.tsx (#27441) --- webapp/channels/src/components/app.tsx | 9 ++------- .../channel_layout/channel_controller.test.tsx | 4 ++++ .../src/components/channel_layout/channel_controller.tsx | 2 ++ webapp/channels/src/components/root/index.ts | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/webapp/channels/src/components/app.tsx b/webapp/channels/src/components/app.tsx index bf1a069124..fdf1d8a0f7 100644 --- a/webapp/channels/src/components/app.tsx +++ b/webapp/channels/src/components/app.tsx @@ -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 ( - - + ); diff --git a/webapp/channels/src/components/channel_layout/channel_controller.test.tsx b/webapp/channels/src/components/channel_layout/channel_controller.test.tsx index d7025d4cf7..8e35fa0c85 100644 --- a/webapp/channels/src/components/channel_layout/channel_controller.test.tsx +++ b/webapp/channels/src/components/channel_layout/channel_controller.test.tsx @@ -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(); diff --git a/webapp/channels/src/components/channel_layout/channel_controller.tsx b/webapp/channels/src/components/channel_layout/channel_controller.tsx index 5902dcbf89..37d0a39f3b 100644 --- a/webapp/channels/src/components/channel_layout/channel_controller.tsx +++ b/webapp/channels/src/components/channel_layout/channel_controller.tsx @@ -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 ( <> +