diff --git a/Source/Promise+Progress.swift b/Source/Promise+Progress.swift index f20bc9e466a..a919ac2e120 100644 --- a/Source/Promise+Progress.swift +++ b/Source/Promise+Progress.swift @@ -11,7 +11,6 @@ import Foundation public extension Promise { @discardableResult public func progress(_ block: @escaping (Float) -> Void) -> Promise { - tryStartInitialPromiseAndStartIfneeded() let p = newLinkedPromise() syncStateWithCallBacks( success: p.fulfill, diff --git a/thenTests/Helpers.swift b/thenTests/Helpers.swift index 739c05577a6..9c7c5b8a057 100644 --- a/thenTests/Helpers.swift +++ b/thenTests/Helpers.swift @@ -116,9 +116,11 @@ func waitTime(_ time: Double, callback: @escaping () -> Void) { func upload() -> Promise { return Promise { (resolve: @escaping (() -> Void), _: @escaping ((Error) -> Void), progress) in + progress(0.8) waitTime { progress(0.8) waitTime { + progress(0.8) resolve() } } @@ -127,9 +129,11 @@ func upload() -> Promise { func failingUpload() -> Promise { return Promise { (_: @escaping (() -> Void), reject: @escaping ((Error) -> Void), progress) in + progress(0.8) waitTime { progress(0.8) waitTime { + progress(0.8) reject(NSError(domain: "", code: 1223, userInfo: nil)) } }