We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb6e23e commit e0fb413Copy full SHA for e0fb413
Sources/Core/Client/Client+Setup.swift
@@ -8,7 +8,15 @@
8
9
import Foundation
10
import Moya
11
+
12
+#if canImport(Faye)
13
import Faye
14
+#else
15
+extension Client {
16
+ struct FayeClient { func disconnect() {} }
17
+ static let fayeClient = FayeClient()
18
+}
19
+#endif
20
21
// MARK: - Client User Setup
22
@@ -35,7 +43,10 @@ extension Client {
35
43
/// - Returns: an object to cancel the request.
36
44
@discardableResult
37
45
public func setupUser<T: UserProtocol>(_ user: T, token: Token, completion: @escaping UserCompletion<T>) -> Cancellable {
38
- Client.fayeClient.disconnect()
46
+ if NSClassFromString("Faye.Client") != nil {
47
+ Client.fayeClient.disconnect()
48
+ }
49
39
50
parseToken(token)
40
51
41
52
guard let currentUserId = currentUserId else {
0 commit comments