@trap_stevo/filetide-client 0.0.42 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -250,6 +250,13 @@ class FileTideClient {
250
250
  }
251
251
  return;
252
252
  }
253
+ refreshConnection(reconnectClient = true, onReconnect, onDisconnect, ...clientConfigurations) {
254
+ if (!reconnectClient) {
255
+ return;
256
+ }
257
+ this.startClient(this.clientOptions, this.connectionOptions, this.transportOptions, this.messagerSettings, onReconnect, onDisconnect, ...clientConfigurations);
258
+ return;
259
+ }
253
260
 
254
261
  // --- FileTide Client Transfer Management ---
255
262
 
@@ -303,16 +310,16 @@ class FileTideClient {
303
310
 
304
311
  // --- FileTide Client Client Settings Management ---
305
312
 
306
- changeRoom(room, completion, onReconnect, onDisconnect, ...clientConfigurations) {
313
+ changeRoom(room, completion, reconnectClient = true, onReconnect, onDisconnect, ...clientConfigurations) {
307
314
  this.currentRoom = room;
308
315
  FileTide.outputGradient(`[${this.deviceName}] Updated room to ${this.currentRoom}`, ["#4D96FF", "#89CFF0"]);
309
- this.startClient(this.clientOptions, this.connectionOptions, this.transportOptions, this.messagerSettings, onReconnect, onDisconnect, ...clientConfigurations);
316
+ this.refreshConnection(reconnectClient, onReconnect, onDisconnect, ...clientConfigurations);
310
317
  if (completion) {
311
318
  completion(room, true);
312
319
  }
313
320
  return;
314
321
  }
315
- async changeClientID(clientID, completion, onReconnect, onDisconnect, ...clientConfigurations) {
322
+ async changeClientID(clientID, completion, reconnectClient = true, onReconnect, onDisconnect, ...clientConfigurations) {
316
323
  const clientOnline = await this.fileMessagerInstance.clientTide.emitEventWithResponse(clientID, "check-client-online", "retrieved-client-online", {
317
324
  clientID
318
325
  }, 5000);
@@ -332,7 +339,7 @@ class FileTideClient {
332
339
  this.fileMessagerInstance.clientTide.closeSocket(this.deviceName);
333
340
  this.deviceName = clientID;
334
341
  FileTide.outputGradient(`[${pDeviceName}] Updated client name to ${this.deviceName}`, ["#4D96FF", "#89CFF0"]);
335
- this.startClient(this.clientOptions, this.connectionOptions, this.transportOptions, this.messagerSettings, onReconnect, onDisconnect, ...clientConfigurations);
342
+ this.refreshConnection(reconnectClient, onReconnect, onDisconnect, ...clientConfigurations);
336
343
  updatedClientID = true;
337
344
  }
338
345
  if (completion) {
@@ -340,10 +347,10 @@ class FileTideClient {
340
347
  }
341
348
  return;
342
349
  }
343
- changeTideUrl(url, completion, onReconnect, onDisconnect, ...clientConfigurations) {
350
+ changeTideUrl(url, completion, reconnectClient = true, onReconnect, onDisconnect, ...clientConfigurations) {
344
351
  this.tideUrl = url;
345
352
  FileTide.outputGradient(`[${this.deviceName}] Updated tide URL to ${this.tideUrl}`, ["#4D96FF", "#89CFF0"]);
346
- this.startClient(this.clientOptions, this.connectionOptions, this.transportOptions, this.messagerSettings, onReconnect, onDisconnect, ...clientConfigurations);
353
+ this.refreshConnection(reconnectClient, onReconnect, onDisconnect, ...clientConfigurations);
347
354
  if (completion) {
348
355
  completion(url, true);
349
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trap_stevo/filetide-client",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "Seamless, real-time file transfers between devices with effortless connectivity. Allowing for powerful, instant, secure, and cross-platform file sharing, enabling efficient and reliable data transfers in any network environment.",
5
5
  "main": "dist/cjs/FileTideClient.js",
6
6
  "exports": {
@@ -37,7 +37,7 @@
37
37
  "author": "Steven Compton",
38
38
  "license": "See License in LICENSE.md",
39
39
  "dependencies": {
40
- "@trap_stevo/filetide": "^0.0.74",
40
+ "@trap_stevo/filetide": "^0.0.76",
41
41
  "@trap_stevo/iotide": "^0.0.44",
42
42
  "@trap_stevo/legendarybuilderpronodejs-utilities": "^1.0.49",
43
43
  "chalk": "^4.1.2"