Skip to content

Commit 4e3d867

Browse files
committed
refactor: address PR review feedback from Tomato6966
- Filters.ts: spread defaults first, then existing timescale, then new value in setSpeed/setPitch/setRate for guaranteed key coverage. - Node.ts: use early return in closeOnError block instead of if/else.
1 parent 19ee6aa commit 4e3d867

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/structures/Filters.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ export class FilterManager {
468468

469469
this.filters.nightcore = false;
470470
this.filters.vaporwave = false;
471-
this.data.timescale = { ...(this.data.timescale ?? DEFAULT_FILTER_DATAS.timescale), speed };
471+
this.data.timescale = { ...DEFAULT_FILTER_DATAS.timescale, ...this.data.timescale, speed };
472472

473473
this.isCustomFilterActive();
474474

@@ -494,7 +494,7 @@ export class FilterManager {
494494

495495
this.filters.nightcore = false;
496496
this.filters.vaporwave = false;
497-
this.data.timescale = { ...(this.data.timescale ?? DEFAULT_FILTER_DATAS.timescale), pitch };
497+
this.data.timescale = { ...DEFAULT_FILTER_DATAS.timescale, ...this.data.timescale, pitch };
498498

499499
this.isCustomFilterActive();
500500

@@ -520,7 +520,7 @@ export class FilterManager {
520520

521521
this.filters.nightcore = false;
522522
this.filters.vaporwave = false;
523-
this.data.timescale = { ...(this.data.timescale ?? DEFAULT_FILTER_DATAS.timescale), rate };
523+
this.data.timescale = { ...DEFAULT_FILTER_DATAS.timescale, ...this.data.timescale, rate };
524524

525525
this.isCustomFilterActive();
526526

src/structures/Node.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,9 +1777,9 @@ export class LavalinkNode {
17771777
if (this.heartBeatInterval) clearInterval(this.heartBeatInterval);
17781778
if (this.pingTimeout) clearTimeout(this.pingTimeout);
17791779
this.socket?.close(500, "Node-Error - Force Reconnect");
1780-
} else {
1781-
this.reconnect();
1780+
return;
17821781
}
1782+
this.reconnect();
17831783
}
17841784

17851785
/** @private util function for handling message events from websocket */

0 commit comments

Comments
 (0)