Skip to content

Commit a5b72bf

Browse files
author
Srirang.Kalantri
committed
fix: wrapping awaited promise in try-catch
1 parent 937ef54 commit a5b72bf

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88

99
### Changed
1010

11-
- We replaced the depricated CameraRoll.saveToCameraRoll with CameraRoll.saveAsset in SaveToPictureLibrary activity.
11+
- We replaced the deprecated CameraRoll.saveToCameraRoll with CameraRoll.saveAsset in SaveToPictureLibrary activity.
1212
- Add await to API calls updated to async in recent update
1313

1414
## [11.4.1] Native Mobile Resources - 2026-3-14

packages/jsActions/mobile-resources-native/src/camera/SaveToPictureLibrary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export async function SaveToPictureLibrary(picture?: mendix.lib.MxObject): Promi
2929

3030
const guid = picture.getGuid();
3131
const changedDate = picture.get("changedDate") as number;
32-
const url = await mx.data.getDocumentUrl(guid, changedDate);
3332

3433
// Save the file as a photo to the camera roll.
3534
try {
35+
const url = await mx.data.getDocumentUrl(guid, changedDate);
3636
const savedUri = await CameraRoll.saveAsset(url);
3737
return Promise.resolve(savedUri.node.image.uri);
3838
} catch (error) {

packages/jsActions/mobile-resources-native/src/platform/PlaySound.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export async function PlaySound(audioFile?: mendix.lib.MxObject): Promise<void>
3232

3333
const guid = audioFile.getGuid();
3434
const changedDate = audioFile.get("changedDate") as number;
35-
const url = await mx.data.getDocumentUrl(guid, changedDate);
3635

3736
try {
37+
const url = await mx.data.getDocumentUrl(guid, changedDate);
3838
// Initialize the player if it hasn't been set up yet
3939
const state = await TrackPlayer.getPlaybackState();
4040
if (state.state === State.None) {

0 commit comments

Comments
 (0)