refactor: ♻️ Refactoring
This commit is contained in:
parent
b808fa50f0
commit
514a2112d5
|
@ -303,7 +303,7 @@ export default abstract class RecordsPage<
|
||||||
onTablePageChange(event: CustomEvent<PaginateDetail>) {
|
onTablePageChange(event: CustomEvent<PaginateDetail>) {
|
||||||
const {pageSize, action} = event.detail;
|
const {pageSize, action} = event.detail;
|
||||||
this.currentPageSize = pageSize;
|
this.currentPageSize = pageSize;
|
||||||
const currentPage = this.currentPage;
|
const {currentPage} = this;
|
||||||
match(action)
|
match(action)
|
||||||
.with('first', () => (this.currentPage = 1))
|
.with('first', () => (this.currentPage = 1))
|
||||||
.with('previous', () => (this.currentPage--))
|
.with('previous', () => (this.currentPage--))
|
||||||
|
@ -311,7 +311,6 @@ export default abstract class RecordsPage<
|
||||||
.with('last', () => (this.currentPage = this.lastPage))
|
.with('last', () => (this.currentPage = this.lastPage))
|
||||||
.with('current', () => {})
|
.with('current', () => {})
|
||||||
.run();
|
.run();
|
||||||
console.log('onTablePageChange', event.detail);
|
|
||||||
if (currentPage !== this.currentPage) {
|
if (currentPage !== this.currentPage) {
|
||||||
this.refreshRecords = true;
|
this.refreshRecords = true;
|
||||||
m.redraw();
|
m.redraw();
|
||||||
|
|
Loading…
Reference in New Issue