Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
* Prevent from dispatching .unsubscribeAll if the current state is UnsubscribedState
* Added missing initializers for StatusListener and EventListener:
  • Loading branch information
jguz-pubnub committed Aug 20, 2024
1 parent d4f2b0f commit ff96bfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SubscribeTransition: TransitionProtocol {
case .subscriptionRestored:
return true
case .unsubscribeAll:
return true
return !(state is Subscribe.UnsubscribedState)
case .disconnect:
return !(
state is Subscribe.HandshakeStoppedState || state is Subscribe.ReceiveStoppedState ||
Expand Down
4 changes: 2 additions & 2 deletions Sources/PubNub/Events/New/EventListenerInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class StatusListener: StatusListenerInterface {
public let queue: DispatchQueue
public var onConnectionStateChange: ((ConnectionStatus) -> Void)?

init(
public init(
uuid: UUID = UUID(),
queue: DispatchQueue = .main,
onConnectionStateChange: @escaping ((ConnectionStatus) -> Void)
Expand Down Expand Up @@ -80,7 +80,7 @@ public class EventListener: EventListenerInterface {
public var onFileEvent: ((PubNubFileChangeEvent) -> Void)?
public var onAppContext: ((PubNubAppContextEvent) -> Void)?

init(
public init(
queue: DispatchQueue = .main,
uuid: UUID = UUID(),
onEvent: ((PubNubEvent) -> Void)? = nil,
Expand Down

0 comments on commit ff96bfb

Please sign in to comment.