Skip to content

Commit c49a646

Browse files
committed
Change private-encrypted channel check also on trigger function
1 parent a2e992d commit c49a646

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

android/src/main/java/com/pusherwebsocketreactnative/PusherWebsocketReactNativeModule.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,8 @@ class PusherWebsocketReactNativeModule(reactContext: ReactApplicationContext) :
124124
@ReactMethod
125125
fun trigger(channelName: String, eventName: String, data: String, promise: Promise) {
126126
when {
127-
channelName.startsWith("private-") -> pusher!!.getPrivateChannel(channelName)
128-
.trigger(eventName, data)
129127
channelName.startsWith("private-encrypted-") -> throw Exception("It's not currently possible to send a message using private encrypted channels.")
128+
channelName.startsWith("private-") -> pusher!!.getPrivateChannel(channelName).trigger(eventName, data)
130129
channelName.startsWith("presence-") -> pusher!!.getPresenceChannel(channelName)
131130
.trigger(eventName, data)
132131
else -> throw Exception("Messages can only be sent to private and presence channels.")

0 commit comments

Comments
 (0)