diff --git a/app/screens/home/channel_list/categories_list/header/header.tsx b/app/screens/home/channel_list/categories_list/header/header.tsx index f21d5f81b..1da5f3626 100644 --- a/app/screens/home/channel_list/categories_list/header/header.tsx +++ b/app/screens/home/channel_list/categories_list/header/header.tsx @@ -150,7 +150,7 @@ const ChannelListHeader = ({ bottomSheet({ closeButtonId, renderContent, - snapPoints: [bottomSheetSnapPoint(items, ITEM_HEIGHT, insets.bottom, separators, SEPARATOR_HEIGHT), 10], + snapPoints: [bottomSheetSnapPoint(items, ITEM_HEIGHT, insets.bottom) + (separators * SEPARATOR_HEIGHT), 10], theme, title: intl.formatMessage({id: 'home.header.plus_menu', defaultMessage: 'Options'}), }); diff --git a/app/screens/home/channel_list/categories_list/header/index.ts b/app/screens/home/channel_list/categories_list/header/index.ts index ef99d7958..4d638cf3d 100644 --- a/app/screens/home/channel_list/categories_list/header/index.ts +++ b/app/screens/home/channel_list/categories_list/header/index.ts @@ -8,7 +8,7 @@ import {switchMap} from 'rxjs/operators'; import {Permissions} from '@constants'; import {observePermissionForTeam} from '@queries/servers/role'; -import {observeConfig, observePushVerificationStatus} from '@queries/servers/system'; +import {observeConfigBooleanValue, observePushVerificationStatus} from '@queries/servers/system'; import {observeCurrentTeam} from '@queries/servers/team'; import {observeCurrentUser} from '@queries/servers/user'; @@ -21,11 +21,7 @@ const enhanced = withObservables([], ({database}: WithDatabaseArgs) => { const currentUser = observeCurrentUser(database); - const config = observeConfig(database); - - const enableOpenServer = config.pipe( - switchMap((t) => of$(t?.EnableOpenServer === 'true')), - ); + const enableOpenServer = observeConfigBooleanValue(database, 'EnableOpenServer'); const canJoinChannels = combineLatest([currentUser, team]).pipe( switchMap(([u, t]) => observePermissionForTeam(database, t, u, Permissions.JOIN_PUBLIC_CHANNELS, true)), diff --git a/app/utils/helpers.ts b/app/utils/helpers.ts index 45d937023..7f55e26ec 100644 --- a/app/utils/helpers.ts +++ b/app/utils/helpers.ts @@ -144,12 +144,12 @@ export async function isTablet() { export const pluckUnique = (key: string) => (array: Array<{[key: string]: unknown}>) => Array.from(new Set(array.map((obj) => obj[key]))); -export function bottomSheetSnapPoint(itemsCount: number, itemHeight: number, bottomInset = 0, separatorCount = 0, separatorHeight = 0) { +export function bottomSheetSnapPoint(itemsCount: number, itemHeight: number, bottomInset = 0) { let bottom = bottomInset; if (!bottom && Platform.OS === 'ios') { bottom = IOS_STATUS_BAR_HEIGHT; } - return ((itemsCount + Platform.select({android: 1, default: 0})) * itemHeight) + (separatorCount * separatorHeight) + (bottom * 2.5); + return ((itemsCount + Platform.select({android: 1, default: 0})) * itemHeight) + (bottom * 2.5); } export function hasTrailingSpaces(term: string) {