diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c5c6ec32a..c37a13e813 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,6 +19,10 @@ executors: resource_class: <> ios: + parameters: + resource_class: + default: medium + type: string environment: NODE_OPTIONS: --max_old_space_size=12000 NODE_ENV: production @@ -27,6 +31,7 @@ executors: xcode: "13.3.0" working_directory: ~/mattermost-mobile shell: /bin/bash --login -o pipefail + resource_class: <> commands: checkout-private: @@ -342,7 +347,9 @@ jobs: # filename: "*.apk" build-ios-beta: - executor: ios + executor: + name: ios + resource_class: large steps: - build-ios - persist diff --git a/app/screens/home/channel_list/additional_tablet_view/index.tsx b/app/screens/home/channel_list/additional_tablet_view/additional_tablet_view.tsx similarity index 71% rename from app/screens/home/channel_list/additional_tablet_view/index.tsx rename to app/screens/home/channel_list/additional_tablet_view/additional_tablet_view.tsx index dee5a3dca8..e210d89fb7 100644 --- a/app/screens/home/channel_list/additional_tablet_view/index.tsx +++ b/app/screens/home/channel_list/additional_tablet_view/additional_tablet_view.tsx @@ -13,13 +13,21 @@ type SelectedView = { Component: any; } +type Props = { + currentChannelId: string; + isCRTEnabled: boolean; +} + const ComponentsList: Record = { [Screens.CHANNEL]: Channel, [Screens.GLOBAL_THREADS]: GlobalThreads, }; -const AdditionalTabletView = () => { - const [selected, setSelected] = useState(); +const channelScreen: SelectedView = {id: Screens.CHANNEL, Component: Channel}; +const globalScreen: SelectedView = {id: Screens.GLOBAL_THREADS, Component: GlobalThreads}; + +const AdditionalTabletView = ({currentChannelId, isCRTEnabled}: Props) => { + const [selected, setSelected] = useState(isCRTEnabled && !currentChannelId ? globalScreen : channelScreen); useEffect(() => { const listener = DeviceEventEmitter.addListener(Navigation.NAVIGATION_HOME, (id: string) => { diff --git a/app/screens/home/channel_list/additional_tablet_view/index.ts b/app/screens/home/channel_list/additional_tablet_view/index.ts new file mode 100644 index 0000000000..01ca730e65 --- /dev/null +++ b/app/screens/home/channel_list/additional_tablet_view/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import {withDatabase} from '@nozbe/watermelondb/DatabaseProvider'; +import withObservables from '@nozbe/with-observables'; + +import {observeCurrentChannelId} from '@queries/servers/system'; +import {observeIsCRTEnabled} from '@queries/servers/thread'; + +import AdditionalTabletView from './additional_tablet_view'; + +import type {WithDatabaseArgs} from '@typings/database/database'; + +const enhanced = withObservables([], ({database}: WithDatabaseArgs) => ({ + currentChannelId: observeCurrentChannelId(database), + isCRTEnabled: observeIsCRTEnabled(database), +})); + +export default withDatabase(enhanced(AdditionalTabletView)); diff --git a/ios/Mattermost/Info.plist b/ios/Mattermost/Info.plist index 76f9d304b1..ff036217a8 100644 --- a/ios/Mattermost/Info.plist +++ b/ios/Mattermost/Info.plist @@ -111,6 +111,8 @@ armv7 + UIRequiresFullScreen + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait