diff --git a/src/client.ts b/src/client.ts index ab055e0f..0fae9c88 100644 --- a/src/client.ts +++ b/src/client.ts @@ -252,7 +252,6 @@ export function createClient(options: ClientOptions): Client { return; } - subscribedSinks[uuid] = sink; messageListener = socky.registerMessageListener(({ data }) => { const message = parseMessage(data); switch (message.type) { @@ -285,6 +284,9 @@ export function createClient(options: ClientOptions): Client { payload, }), ); + + // the sink is now subscribed + subscribedSinks[uuid] = sink; }) .catch(sink.error);