From 1889ffeeee16f655c5b1c1f08f507bfbb46b84ce Mon Sep 17 00:00:00 2001 From: Peter Zignego Date: Tue, 26 Jul 2016 19:11:26 -0400 Subject: [PATCH] Fix callback bug when authing via a provided token --- SlackKit/Sources/SlackKit.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SlackKit/Sources/SlackKit.swift b/SlackKit/Sources/SlackKit.swift index c14fc68..fd3678f 100644 --- a/SlackKit/Sources/SlackKit.swift +++ b/SlackKit/Sources/SlackKit.swift @@ -35,7 +35,9 @@ public final class SlackKit: OAuthDelegate { public init(withAPIToken token: String, clientOptions: ClientOptions = ClientOptions()) { self.clientOptions = clientOptions let client = Client(apiToken: token) - self.onClientInitalization?(client) + dispatch_async(dispatch_get_main_queue(), { + self.onClientInitalization?(client) + }) clients[token] = client client.connect(options: self.clientOptions) }