diff --git a/webapp/channels/src/components/actions_menu/actions_menu.tsx b/webapp/channels/src/components/actions_menu/actions_menu.tsx index ec540a994a..cbd8ba2281 100644 --- a/webapp/channels/src/components/actions_menu/actions_menu.tsx +++ b/webapp/channels/src/components/actions_menu/actions_menu.tsx @@ -273,8 +273,6 @@ export class ActionMenuClass extends React.PureComponent { return null; } - // const isMobile = this.props.isMobileView TODO; - const pluginItems = this.props.pluginMenuItems?. filter((item) => { return item.filter ? item.filter(this.props.post.id) : item; diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/index.ts b/webapp/channels/src/components/admin_console/admin_sidebar/index.ts index 5873ce4e61..dd3c2997da 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/index.ts +++ b/webapp/channels/src/components/admin_console/admin_sidebar/index.ts @@ -15,10 +15,9 @@ import {ActionFunc} from 'mattermost-redux/types/actions'; import {GlobalState} from 'types/store'; -import {isMobile} from 'utils/utils'; - -import {getNavigationBlocked} from 'selectors/views/admin'; import {getAdminDefinition, getConsoleAccess} from 'selectors/admin_console'; +import {getNavigationBlocked} from 'selectors/views/admin'; +import {getIsMobileView} from 'selectors/views/browser'; import {OnboardingTaskCategory, OnboardingTaskList} from 'components/onboarding_tasks'; @@ -33,7 +32,7 @@ function mapStateToProps(state: GlobalState) { const consoleAccess = getConsoleAccess(state); const taskListStatus = getBool(state, OnboardingTaskCategory, OnboardingTaskList.ONBOARDING_TASK_LIST_SHOW); const isUserFirstAdmin = isFirstAdmin(state); - const isMobileView = isMobile(); + const isMobileView = getIsMobileView(state); const showTaskList = isUserFirstAdmin && taskListStatus && !isMobileView; const subscriptionProduct = getSubscriptionProduct(state); diff --git a/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx b/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx index 02664431c0..ce9e03dfe8 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx @@ -107,6 +107,11 @@ const initialState = { config: {PostEditTimeLimit: -1}, }, }, + views: { + browser: { + windowSize: '', + }, + }, }; describe('channel_info_rhs/about_area_gm', () => { diff --git a/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx b/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx index 9e63dd0ad3..f86e22eab1 100644 --- a/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx +++ b/webapp/channels/src/components/linking_landing_page/linking_landing_page.tsx @@ -160,14 +160,14 @@ export default class LinkingLandingPage extends PureComponent { renderGoNativeAppMessage = () => { return ( { this.setPreference(LandingPreferenceTypes.MATTERMOSTAPP, true); }} onClick={() => { this.setPreference(LandingPreferenceTypes.MATTERMOSTAPP, true); this.setState({redirectPage: true, navigating: true}); - if (Utils.isMobile()) { + if (UserAgent.isMobile()) { if (UserAgent.isAndroidWeb()) { const timeout = setTimeout(() => { window.location.replace(this.getDownloadLink()!); diff --git a/webapp/channels/src/components/search_bar/search_bar.test.tsx b/webapp/channels/src/components/search_bar/search_bar.test.tsx index 4e5f308435..2827134e24 100644 --- a/webapp/channels/src/components/search_bar/search_bar.test.tsx +++ b/webapp/channels/src/components/search_bar/search_bar.test.tsx @@ -22,14 +22,6 @@ const suggestionProviders = [ new SearchUserProvider(jest.fn()), ]; -jest.mock('utils/utils', () => { - const original = jest.requireActual('utils/utils'); - return { - ...original, - isMobile: jest.fn(() => false), - }; -}); - const wrapIntl = (component: JSX.Element) => ( { return (