Skip to content

Commit

Permalink
fix(PagesBuilder): fix infinity loop
Browse files Browse the repository at this point in the history
  • Loading branch information
egorprnn committed Apr 20, 2021
1 parent 3a0e8de commit 51f7537
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vk-io-pages",
"version": "1.6.2",
"version": "1.6.3",
"description": "Модуль vk-io для создания динамических страниц",
"scripts": {
"tsc": "tsc && node --experimental-modules --es-module-specifier-resolution=node ./scripts/removeEmptyFiles.mjs",
Expand Down
6 changes: 3 additions & 3 deletions src/PagesBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export class PagesBuilder extends Event.EventEmitter {
return;
}

this.setPage();
this.setPage(1);

break;
case "back":
Expand All @@ -461,7 +461,7 @@ export class PagesBuilder extends Event.EventEmitter {
case "next":
if (this.currentPage === this.pages.length) {
if (this.infinityLoop) {
this.setPage();
this.setPage(1);
}

return;
Expand All @@ -473,7 +473,7 @@ export class PagesBuilder extends Event.EventEmitter {
case "last":
if (this.currentPage === this.pages.length) {
if (this.infinityLoop) {
this.setPage();
this.setPage(1);
}

return;
Expand Down

0 comments on commit 51f7537

Please sign in to comment.