diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6aa134..0efdf2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,8 @@ name: Check Code Quality on: - push: - branches: [main, master, develop] pull_request: - branches: [main, master, develop] + branches: [main, develop] jobs: lint-and-tests: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 363ae9d..17b06e2 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,8 +1,6 @@ name: Generate Documentation on: - pull_request: - branches: [main] push: branches: [main] diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 9be73e0..0048825 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -619,7 +619,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 1579bf3207afadc72ac3638a66a102d1bf5263e3 React-jsinspector: 14a342151ab810862998dfc99e2720746734e9b3 React-logger: 94ec392ae471683635e4bf874d4e82f675399d2d - react-native-pitch-detector: 89ba140b11ebe97eb30d2e0f1f5be4fb06b8e64e + react-native-pitch-detector: 1208843b2b47df38210a8ed5cf4905e35457b858 React-perflogger: 883a55a9a899535eaf06d0029108ef9ef22cce92 React-RCTActionSheet: 1a3b8416688a3d291367be645022886f71d6842a React-RCTAnimation: e5560cb72d91ba35151d51e2eb0d467b42763f43 diff --git a/ios/PitchDetector/PitchDetectorModule.swift b/ios/PitchDetector/PitchDetectorModule.swift index 0c7afb3..f635075 100644 --- a/ios/PitchDetector/PitchDetectorModule.swift +++ b/ios/PitchDetector/PitchDetectorModule.swift @@ -34,21 +34,14 @@ open class PitchDetectorModule: RCTEventEmitter { } @objc(start:resolve:reject:) - func start( - _ config: Dictionary, - resolve:@escaping RCTPromiseResolveBlock, - reject:@escaping RCTPromiseRejectBlock - ) -> Void { + func start(_ config: Dictionary, resolve:@escaping RCTPromiseResolveBlock, reject:@escaping RCTPromiseRejectBlock) -> Void { if (!self.recording) { let promise = PromiseUtils(resolve, reject) - do { - processor.start(config) - self.recording = true - promise.resolve(nil) - } catch { - self.recording = false - promise.reject(error as NSError) - } + + processor.start(config) + self.recording = true + + return promise.resolve(nil) } } @@ -56,24 +49,17 @@ open class PitchDetectorModule: RCTEventEmitter { func stop(resolve:@escaping RCTPromiseResolveBlock,reject:@escaping RCTPromiseRejectBlock) -> Void { if (self.recording) { let promise = PromiseUtils(resolve, reject) - do { - processor.stop() - self.recording = false - promise.resolve(nil) - } catch { - self.recording = false - promise.reject(error as NSError) - } + + processor.stop() + self.recording = false + + return promise.resolve(nil) } } @objc(isRecording:reject:) func isRecording(resolve:@escaping RCTPromiseResolveBlock,reject:@escaping RCTPromiseRejectBlock) -> Void { let promise = PromiseUtils(resolve, reject) - do { - promise.resolve(self.recording) - } catch { - promise.reject(error as NSError) - } + return promise.resolve(self.recording) } }