Skip to content

Commit 9ea55e9

Browse files
emma-sgSuaYoo
andcommitted
apply suggestion from code review
Co-authored-by: sua yoo <sua@suayoo.com>
1 parent c27eb30 commit 9ea55e9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

frontend/src/components/ui/pagination.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,15 @@ export class Pagination extends LitElement {
141141

142142
searchParams = new SearchParamsController(this, (params) => {
143143
const page = parsePage(params.get(this.name));
144-
this.onPageChange(page);
144+
if (this.page !== page) {
145+
this.dispatchEvent(
146+
new CustomEvent<PageChangeDetail>("page-change", {
147+
detail: { page: page, pages: this.pages },
148+
composed: true,
149+
}),
150+
);
151+
this.page = page;
152+
}
145153
});
146154

147155
@state()

0 commit comments

Comments
 (0)