Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Apr 20, 2023
1 parent dede625 commit 41ba145
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/FormAPIEx.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var version = "0.3.0";
var version = "0.3.1";

const NAME = 'FormAPIEx';
const VERSION = (version.split('.').map((v) => Number(v)));
Expand Down Expand Up @@ -535,8 +535,7 @@ class SimpleFormEx {
if (resultIndex === offset) {
const res = await this.sendSearchForm(player);
if (res === false || res === null) {
// eslint-disable-next-line no-return-await
return await this.sendAsync(player, page);
return this.sendAsync(player, page);
}
return res;
}
Expand All @@ -549,21 +548,18 @@ class SimpleFormEx {
default: page,
})
.sendAsync(player);
// eslint-disable-next-line no-return-await
return await this.sendAsync(player, res ? res.num : page);
return this.sendAsync(player, res ? res.num : page);
}
offset += 1;
}
if (hasPreviousPage) {
if (resultIndex === offset) {
// eslint-disable-next-line no-return-await
return await this.sendAsync(player, page - 1);
return this.sendAsync(player, page - 1);
}
offset += 1;
}
if (hasNextPage && resultIndex + 1 === formattedButtons.length) {
// eslint-disable-next-line no-return-await
return await this.sendAsync(player, page + 1);
return this.sendAsync(player, page + 1);
}
const realIndex = resultIndex - offset;
return buttons[realIndex];
Expand Down

0 comments on commit 41ba145

Please sign in to comment.