From be6acac6f051b290d96e14353704065e4928b53a Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Tue, 3 Sep 2024 15:41:53 +0200 Subject: [PATCH 1/2] fix: concurrent unmount when app is offline --- src/components/OfflineWithFeedback.tsx | 2 +- src/styles/index.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/OfflineWithFeedback.tsx b/src/components/OfflineWithFeedback.tsx index d56f60b7a8d2..794d8ab59f1e 100644 --- a/src/components/OfflineWithFeedback.tsx +++ b/src/components/OfflineWithFeedback.tsx @@ -138,7 +138,7 @@ function OfflineWithFeedback({ )} {!hideChildren && ( {children} diff --git a/src/styles/index.ts b/src/styles/index.ts index 179e886d08ff..37776de41b51 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -71,7 +71,7 @@ type WorkspaceUpgradeIntroBoxParams = {isExtraSmallScreenWidth: boolean; isSmall type Translation = 'perspective' | 'rotate' | 'rotateX' | 'rotateY' | 'rotateZ' | 'scale' | 'scaleX' | 'scaleY' | 'translateX' | 'translateY' | 'skewX' | 'skewY' | 'matrix'; -type OfflineFeedbackStyle = Record<'deleted' | 'pending' | 'error' | 'container' | 'textContainer' | 'text' | 'errorDot', ViewStyle | TextStyle>; +type OfflineFeedbackStyle = Record<'deleted' | 'pending' | 'default' | 'error' | 'container' | 'textContainer' | 'text' | 'errorDot', ViewStyle | TextStyle>; type MapDirectionStyle = Pick; @@ -3450,6 +3450,9 @@ const styles = (theme: ThemeColors) => pending: { opacity: 0.5, }, + default: { + opacity: 0.99, + }, error: { flexDirection: 'row', alignItems: 'center', From e42ab85524cc0c298f0e6349473659b769466b88 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Tue, 10 Sep 2024 15:03:03 +0200 Subject: [PATCH 2/2] fix: apply workaround only to iOS and add meaningful comment --- src/styles/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/styles/index.ts b/src/styles/index.ts index 37776de41b51..5c813998267b 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -3,7 +3,7 @@ import type {LineLayerStyleProps} from '@rnmapbox/maps/src/utils/MapboxStyles'; import lodashClamp from 'lodash/clamp'; import type {LineLayer} from 'react-map-gl'; import type {AnimatableNumericValue, Animated, ImageStyle, TextStyle, ViewStyle} from 'react-native'; -import {StyleSheet} from 'react-native'; +import {Platform, StyleSheet} from 'react-native'; import type {CustomAnimation} from 'react-native-animatable'; import type {PickerStyle} from 'react-native-picker-select'; import type {MixedStyleDeclaration, MixedStyleRecord} from 'react-native-render-html'; @@ -3451,7 +3451,10 @@ const styles = (theme: ThemeColors) => opacity: 0.5, }, default: { - opacity: 0.99, + // fixes a crash on iOS when we attempt to remove already unmounted children + // see https://github.com/Expensify/App/issues/48197 for more details + // it's a temporary solution while we are working on a permanent fix + opacity: Platform.OS === 'ios' ? 0.99 : undefined, }, error: { flexDirection: 'row',