Skip to content

Commit

Permalink
Fix: added index can be wrong (#2477)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtripg6666tdr authored Jul 8, 2024
1 parent cea7cf9 commit 3ff7e66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Component/queueManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class QueueManager extends ServerManagerBase<QueueManagerEvents> {

this.emit(method === "push" ? "changeWithoutCurrent" : "change");
this.emit("add", result);
const index = this._default.findIndex(q => q === result);
const index = method === "push" ? this._default.findLastIndex(q => q === result) : this._default.findIndex(q => q === result);
this.logger.info(`queue content added at position ${index}`);
return { ...result, index };
}
Expand Down

0 comments on commit 3ff7e66

Please sign in to comment.