Skip to content

Commit 1682381

Browse files
committed
chore: more code simplification + update ios pods with latest deps
1 parent 74f98b2 commit 1682381

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

example/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,10 @@ PODS:
375375
- React-jsinspector (0.72.7)
376376
- React-logger (0.72.7):
377377
- glog
378-
- react-native-audio-waveform (1.0.0):
378+
- react-native-audio-waveform (2.1.1):
379379
- RCT-Folly (= 2021.07.22.00)
380380
- React-Core
381-
- react-native-safe-area-context (4.9.0):
381+
- react-native-safe-area-context (4.11.0):
382382
- React-Core
383383
- React-NativeModulesApple (0.72.7):
384384
- hermes-engine
@@ -494,7 +494,7 @@ PODS:
494494
- React-Core
495495
- RNFS (2.20.0):
496496
- React-Core
497-
- RNGestureHandler (2.14.0):
497+
- RNGestureHandler (2.19.0):
498498
- RCT-Folly (= 2021.07.22.00)
499499
- React-Core
500500
- SocketRocket (0.6.1)
@@ -714,8 +714,8 @@ SPEC CHECKSUMS:
714714
React-jsiexecutor: c49502e5d02112247ee4526bc3ccfc891ae3eb9b
715715
React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91
716716
React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f
717-
react-native-audio-waveform: 7cdb6e4963eeae907240396975b9c79713591758
718-
react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b
717+
react-native-audio-waveform: 351a96a6b413c70b096347c880910dc35b6367b7
718+
react-native-safe-area-context: 851c62c48dce80ccaa5637b6aa5991a1bc36eca9
719719
React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a
720720
React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a
721721
React-RCTActionSheet: 392090a3abc8992eb269ef0eaa561750588fc39d
@@ -735,7 +735,7 @@ SPEC CHECKSUMS:
735735
ReactCommon: 5f704096ccf7733b390f59043b6fa9cc180ee4f6
736736
rn-fetch-blob: f065bb7ab7fb48dd002629f8bdcb0336602d3cba
737737
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
738-
RNGestureHandler: 32a01c29ecc9bb0b5bf7bc0a33547f61b4dc2741
738+
RNGestureHandler: 7ad14a6c7b491add489246611d324f10009083ac
739739
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
740740
Yoga: 4c3aa327e4a6a23eeacd71f61c81df1bcdf677d5
741741
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

src/components/Waveform/Waveform.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,16 @@ export const Waveform = forwardRef<IWaveformRef, IWaveform>((props, ref) => {
119119

120120
const preparePlayerForPath = async (progress?: number) => {
121121
if (!isNil(path) && !isEmpty(path)) {
122-
const prepare = await preparePlayer({
122+
return await preparePlayer({
123123
path,
124124
playerKey: `PlayerFor${path}`,
125125
updateFrequency: UpdateFrequency.medium,
126126
volume: volume,
127127
progress,
128128
});
129-
return prepare;
130-
} else {
131-
throw new Error(`Can not start player for path: ${path}`);
132129
}
130+
131+
throw new Error(`Can not start player for path: ${path}`);
133132
};
134133

135134
const getAudioDuration = async () => {
@@ -141,9 +140,9 @@ export const Waveform = forwardRef<IWaveformRef, IWaveform>((props, ref) => {
141140
const audioDuration = Number(duration);
142141
setSongDuration(audioDuration > 0 ? audioDuration : 0);
143142
return audioDuration;
144-
} else {
145-
throw new Error(`Could not get duration for path: ${path}`);
146143
}
144+
145+
throw new Error(`Could not get duration for path: ${path}`);
147146
};
148147

149148
const preparePlayerAndGetDuration = async () => {

0 commit comments

Comments
 (0)