Skip to content

Commit

Permalink
fix: disable
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Feb 19, 2022
1 parent f61a8d1 commit 3b6ac81
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/PaginationEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -860,14 +860,17 @@ export class PaginationEmbed extends MessageEmbed {
.setLabel(this.buttonInfo.last.label)
.setStyle(this.buttonInfo.last.style);
}
Object.values(this.buttons).forEach((button) => button.setDisabled());
this.buttons.first?.setDisabled();
this.buttons.prev?.setDisabled();
this.buttons.next?.setDisabled();
this.buttons.last?.setDisabled();
if (this.totalEntry > this.limit) {
this.buttons.last?.setDisabled(false);
this.buttons.next?.setDisabled(false);
}
if (this.loop) {
this.buttons.first?.setDisabled(true);
this.buttons.prev?.setDisabled(true);
this.buttons.first?.setDisabled(false);
this.buttons.prev?.setDisabled(false);
}
this.mainActionRow.setComponents(Object.values(this.buttons));
this.actionRows = [this.mainActionRow];
Expand Down

0 comments on commit 3b6ac81

Please sign in to comment.