From 385306633063d1845cf3eb6983bf49fc1969a443 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Wed, 17 Aug 2022 22:58:30 +0200 Subject: [PATCH 1/2] Fix Android crash --- .../Shared/HeaderNotification.android.tsx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/Timeline/Shared/HeaderNotification.android.tsx b/src/components/Timeline/Shared/HeaderNotification.android.tsx index 97fab6d8..80120136 100644 --- a/src/components/Timeline/Shared/HeaderNotification.android.tsx +++ b/src/components/Timeline/Shared/HeaderNotification.android.tsx @@ -32,25 +32,25 @@ const TimelineHeaderNotification = ({ queryKey, notification }: Props) => { const shareOnPress = status && status?.visibility !== 'direct' ? contextMenuShare({ - actions: contextMenuActions, - type: 'status', - url: status.url || status.uri - }) + actions: contextMenuActions, + type: 'status', + url: status.url || status.uri + }) : null - const statusOnPress = contextMenuStatus({ + const statusOnPress = status && contextMenuStatus({ actions: contextMenuActions, - status: status!, + status: status, queryKey }) - const accountOnPress = contextMenuAccount({ + const accountOnPress = status && contextMenuAccount({ actions: contextMenuActions, type: 'status', queryKey, - id: status!.account.id + id: status.account.id }) - const instanceOnPress = contextMenuInstance({ + const instanceOnPress = status && contextMenuInstance({ actions: contextMenuActions, - status: status!, + status: status, queryKey }) @@ -106,7 +106,7 @@ const TimelineHeaderNotification = ({ queryKey, notification }: Props) => { style={{ flex: notification.type === 'follow' || - notification.type === 'follow_request' + notification.type === 'follow_request' ? 1 : 4 }} @@ -150,7 +150,7 @@ const TimelineHeaderNotification = ({ queryKey, notification }: Props) => { style={[ { marginLeft: StyleConstants.Spacing.M }, notification.type === 'follow' || - notification.type === 'follow_request' + notification.type === 'follow_request' ? { flexShrink: 1 } : { flex: 1 } ]} From 244eda3d1205d520e95864c86df5ccacb1d8bacb Mon Sep 17 00:00:00 2001 From: xmflsct Date: Thu, 18 Aug 2022 00:21:46 +0200 Subject: [PATCH 2/2] Use proper branch instead of releaseChannel --- android/app/build.gradle | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- fastlane/Fastfile | 6 +++--- ios/tooot/Supporting/Expo.plist | 7 +++++-- src/utils/checkEnvironment.ts | 6 +++--- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2f36faa6..fb8b1377 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -172,7 +172,7 @@ android { } manifestPlaceholders = [ runtimeVersion: project.hasProperty('runtimeVersion') ? project.property('runtimeVersion') : "", - releaseChannel: project.hasProperty('releaseChannel') ? project.property('releaseChannel') : "default" + branch: project.hasProperty('branch') ? project.property('branch') : "development" ] } if (isNewArchitectureEnabled()) { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 043124d8..d6209e89 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ - + diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 66b5c9ad..9791512c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -32,7 +32,7 @@ private_lane :build_ios do DSYM_FILE = "#{BUILD_DIRECTORY}/tooot.app.dSYM.zip" set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesRuntimeVersion", value: VERSION ) - set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesReleaseChannel", value: ENVIRONMENT ) + set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesRequestHeaders", subkey: "expo-channel-name", value: ENVIRONMENT ) setup_ci set_info_plist_value( path: INFO_PLIST, key: "CFBundleShortVersionString", value: VERSION ) @@ -98,7 +98,7 @@ private_lane :build_android do print_command_output: true, properties: { "runtimeVersion" => VERSION, - "releaseChannel" => ENVIRONMENT, + "branch" => ENVIRONMENT, "android.injected.signing.store.file" => "#{File.expand_path('..', Dir.pwd)}/android/tooot.jks", "android.injected.signing.store.password" => ENV["ANDROID_KEYSTORE_PASSWORD"], "android.injected.signing.key.alias" => ENV["ANDROID_KEYSTORE_ALIAS"], @@ -137,7 +137,7 @@ private_lane :build_android_apk do print_command_output: true, properties: { "runtimeVersion" => VERSION, - "releaseChannel" => ENVIRONMENT, + "branch" => ENVIRONMENT, "android.injected.signing.store.file" => "#{File.expand_path('..', Dir.pwd)}/android/tooot.jks", "android.injected.signing.store.password" => ENV["ANDROID_KEYSTORE_PASSWORD"], "android.injected.signing.key.alias" => ENV["ANDROID_KEYSTORE_ALIAS"], diff --git a/ios/tooot/Supporting/Expo.plist b/ios/tooot/Supporting/Expo.plist index 8c6922ef..27a3a226 100644 --- a/ios/tooot/Supporting/Expo.plist +++ b/ios/tooot/Supporting/Expo.plist @@ -8,8 +8,11 @@ EXUpdatesLaunchWaitMs 0 - EXUpdatesReleaseChannel - development + EXUpdatesRequestHeaders + + expo-channel-name + development + EXUpdatesRuntimeVersion 0 EXUpdatesURL diff --git a/src/utils/checkEnvironment.ts b/src/utils/checkEnvironment.ts index a60babf4..08af0d9d 100644 --- a/src/utils/checkEnvironment.ts +++ b/src/utils/checkEnvironment.ts @@ -36,14 +36,14 @@ const mapEnvironment = ({ const isDevelopment = __DEV__ || - ['development'].some(channel => (Updates.channel || Updates.releaseChannel) === channel) + ['development'].some(channel => (Updates.channel) === channel) const isCandidate = ['candidate'].some(channel => - (Updates.channel || Updates.releaseChannel) === channel + (Updates.channel) === channel ) const isRelease = ['release'].some(channel => - (Updates.channel || Updates.releaseChannel) === channel + (Updates.channel) === channel ) export { mapEnvironment, isDevelopment, isCandidate, isRelease }