Skip to content

Commit

Permalink
fix(ios): fix ios promise resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Apr 3, 2024
1 parent 9b7d311 commit cb31518
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ios/RNUploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ class RNUploader: NSObject {

@objc(uploadPart::withResolver:withRejecter:)
func uploadPart(sessionId: String, filePath: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
uploadModule.uploadPart(sessionId: sessionId, filePath: filePath, onProgress: { _ in }, onSuccess: { _ in
resolve(nil)
uploadModule.uploadPart(sessionId: sessionId, filePath: filePath, onProgress: { _ in }, onSuccess: { video in
resolve(video)
}, onError: { error in
reject("upload_part_failed", error.localizedDescription, error)
})
}

@objc(uploadLastPart::withResolver:withRejecter:)
func uploadLastPart(sessionId: String, filePath: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
uploadModule.uploadLastPart(sessionId: sessionId, filePath: filePath, onProgress: { _ in }, onSuccess: { _ in
resolve(nil)
uploadModule.uploadLastPart(sessionId: sessionId, filePath: filePath, onProgress: { _ in }, onSuccess: { video in
resolve(video)
}, onError: { error in
reject("upload_part_failed", error.localizedDescription, error)
reject("upload_last_part_failed", error.localizedDescription, error)
})
}

Expand Down

0 comments on commit cb31518

Please sign in to comment.