Skip to content

Commit a7517cf

Browse files
authored
Update index.tsx
Client id was hardcoded to "ClientId" on every connection which on mosquitto server cause a disconect when multiple devices try to connect to the server. I change the order how ConnectionOptions are merged to prioritise the custom ClientId set outside the library.
1 parent a5f529a commit a7517cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class MqttClient {
176176

177177
const opts: ConnectionOptions = Object.assign(
178178
{},
179-
{ ...options, clientId: 'clientId' }
179+
{ clientId: 'clientId', ...options }
180180
);
181181
if (opts.tls && opts.tls.p12) {
182182
opts.tls = Object.assign({}, opts.tls);

0 commit comments

Comments
 (0)