File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -84,14 +84,11 @@ public class PusherChannel {
84
84
*/
85
85
public func handleEvent( eventName: String , eventData: String ) {
86
86
if let eventHandlerArray = self . eventHandlers [ eventName] {
87
- if let attempt = connection. options. attemptToReturnJSONObject where attempt {
88
- for eventHandler in eventHandlerArray {
89
- eventHandler. callback ( connection. getEventDataJSONFromString ( eventData) )
90
- }
91
- } else {
92
- for eventHandler in eventHandlerArray {
93
- eventHandler. callback ( eventData)
94
- }
87
+
88
+ let jsonize = connection. options. attemptToReturnJSONObject ?? false
89
+
90
+ for eventHandler in eventHandlerArray {
91
+ eventHandler. callback ( jsonize ? connection. getEventDataJSONFromString ( eventData) : eventData)
95
92
}
96
93
}
97
94
}
You can’t perform that action at this time.
0 commit comments