Skip to content

Commit

Permalink
Merge pull request #9 from MohammadRezaAnsari/develop
Browse files Browse the repository at this point in the history
Fix bugs
  • Loading branch information
MohammadRezaAnsari authored Aug 11, 2021
2 parents 701836a + 6f167ac commit 65327fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
10 changes: 0 additions & 10 deletions Sources/SocketKit/Socket/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ public protocol Options {
var activityTimeout: TimeInterval? { get }
}

extension Options {
public var authMethod: AuthMethod {
#if DEBUG
return .inline(secret: "6cbdbeb15886107d0a0e")
#else
return .inline(secret: "")
#endif
}
}

extension PusherClientOptions: Options { }

extension Options {
Expand Down
6 changes: 2 additions & 4 deletions Sources/SocketKit/Socket/Socket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension Socket: SocketManager {
}

public func subscribe(_ name: String) throws {
guard pusher.connection.channels.channels.contains(where: { $0.key != name }) else {
guard !pusher.connection.channels.channels.contains(where: { $0.key == name }) else {
throw(SocketError.channelExist)
}
_ = pusher.subscribe(name)
Expand Down Expand Up @@ -81,15 +81,13 @@ extension Socket {
} catch let error {
handler(.failure(error as! SocketError))
}

return
}


channel.value.bind(eventName: event) { event in

guard let json: String = event.data, let jsonData: Data = json.data(using: .utf8) else {
print("Could not convert JSON string to data")
assertionFailure("ForDebug: Could not convert JSON string to data")
return
}

Expand Down

0 comments on commit 65327fa

Please sign in to comment.