Fix iPad build

This commit is contained in:
Elias Nahum
2022-04-29 17:18:14 -04:00
parent abe23b926c
commit ee01febbb8
4 changed files with 39 additions and 3 deletions

View File

@@ -19,6 +19,10 @@ executors:
resource_class: <<parameters.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: <<parameters.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

View File

@@ -13,13 +13,21 @@ type SelectedView = {
Component: any;
}
type Props = {
currentChannelId: string;
isCRTEnabled: boolean;
}
const ComponentsList: Record<string, React.ReactNode> = {
[Screens.CHANNEL]: Channel,
[Screens.GLOBAL_THREADS]: GlobalThreads,
};
const AdditionalTabletView = () => {
const [selected, setSelected] = useState<SelectedView>();
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<SelectedView>(isCRTEnabled && !currentChannelId ? globalScreen : channelScreen);
useEffect(() => {
const listener = DeviceEventEmitter.addListener(Navigation.NAVIGATION_HOME, (id: string) => {

View File

@@ -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));

View File

@@ -111,6 +111,8 @@
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>