Skip to content

Commit 68eb230

Browse files
committed
Fixes for react compiler.
1 parent 16365f6 commit 68eb230

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/frontend/screens/Audio/AudioAttachmentPlaybackScreen.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ export const AudioAttachmentPlaybackScreen = ({
6565

6666
const handleShare = React.useCallback(async () => {
6767
setShareLoading(true);
68-
try {
69-
let fileUri = localUri;
7068

71-
if (!fileUri) {
69+
let fileUri = localUri;
70+
71+
if (!fileUri) {
72+
try {
7273
const tempFileName = `audio_${Date.now()}.m4a`;
7374
const localFilePath = `${FileSystem.cacheDirectory}${tempFileName}`;
7475
const {uri: downloadedUri} = await FileSystem.downloadAsync(
@@ -78,15 +79,22 @@ export const AudioAttachmentPlaybackScreen = ({
7879

7980
fileUri = downloadedUri;
8081
setLocalUri(downloadedUri);
82+
} catch (err) {
83+
navigation.navigate('ErrorBottomSheet');
84+
Sentry.captureException(err);
85+
setShareLoading(false);
86+
return;
8187
}
88+
}
8289

90+
try {
8391
await Share.open({url: fileUri, failOnCancel: false});
8492
} catch (err) {
8593
navigation.navigate('ErrorBottomSheet');
8694
Sentry.captureException(err);
87-
} finally {
88-
setShareLoading(false);
8995
}
96+
97+
setShareLoading(false);
9098
}, [uri, localUri, navigation]);
9199

92100
React.useEffect(() => {

0 commit comments

Comments
 (0)