From 81e2f7a942c824fb61cb7157cb0df0127659f85e Mon Sep 17 00:00:00 2001 From: Matan Mashraki <12946462+planecore@users.noreply.github.com> Date: Tue, 13 Jun 2023 22:26:47 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20-=20Fixed=20android=20crashes=20?= =?UTF-8?q?(#253)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/sheets/bottom-screen-sheet.tsx | 16 +++++++++------- app/models/route-plan/route-plan.ts | 4 ++-- app/screens/settings/components/settings-box.tsx | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/components/sheets/bottom-screen-sheet.tsx b/app/components/sheets/bottom-screen-sheet.tsx index 8e0c11bb..16732c8d 100644 --- a/app/components/sheets/bottom-screen-sheet.tsx +++ b/app/components/sheets/bottom-screen-sheet.tsx @@ -1,4 +1,4 @@ -import { View, ViewStyle, useColorScheme } from "react-native" +import { Platform, View, ViewStyle, useColorScheme } from "react-native" import { BlurView } from "@react-native-community/blur" import { useSafeAreaInsets } from "react-native-safe-area-context" import { color } from "../../theme" @@ -38,12 +38,14 @@ export function BottomScreenSheet({ children, style }: BottomScreenSheetProps) { }} > {children} - + {Platform.OS === "ios" && ( + + )} ) } diff --git a/app/models/route-plan/route-plan.ts b/app/models/route-plan/route-plan.ts index bf15fd53..5e9516fa 100644 --- a/app/models/route-plan/route-plan.ts +++ b/app/models/route-plan/route-plan.ts @@ -41,11 +41,11 @@ export const RoutePlanModel = types .actions((self) => ({ setOrigin(station) { self.origin = station - sendCurrentRouteToiOS(self.origin.id, self.destination?.id) + sendCurrentRouteToiOS(self.origin?.id, self.destination?.id) }, setDestination(station) { self.destination = station - sendCurrentRouteToiOS(self.origin.id, self.destination?.id) + sendCurrentRouteToiOS(self.origin?.id, self.destination?.id) }, setDate(date) { self.date = date diff --git a/app/screens/settings/components/settings-box.tsx b/app/screens/settings/components/settings-box.tsx index 617c3a5b..dafe79d7 100644 --- a/app/screens/settings/components/settings-box.tsx +++ b/app/screens/settings/components/settings-box.tsx @@ -84,7 +84,7 @@ export const SettingBox = function SettingBox(props: SettingBoxProps) { const { title, icon, first, last, externalLink, chevron, checkmark, onPress, toggle, style } = props let boxStyle: ViewStyle = {} - if (!first) boxStyle = { borderTopColor: Platform.select({ android: "transparent", ios: color.background }), borderTopWidth: 1 } + if (!first && Platform.OS === "ios") boxStyle = { borderTopColor: color.background, borderTopWidth: 1 } if (first) { boxStyle = { borderTopLeftRadius: 10, borderTopRightRadius: 10, ...boxStyle }