diff --git a/docs/widget/src/core/CWDComments.js b/docs/widget/src/core/CWDComments.js index 0901f10..9602272 100644 --- a/docs/widget/src/core/CWDComments.js +++ b/docs/widget/src/core/CWDComments.js @@ -466,8 +466,14 @@ export class CWDComments { onUpdateReplyContent: (content) => this.store.updateReplyContent(content), onClearReplyError: () => this.store.clearReplyError(), replyPlaceholder: this.config.commentPlaceholder, - onPrevPage: () => this.store.goToPage(state.pagination.page - 1), - onNextPage: () => this.store.goToPage(state.pagination.page + 1), + onPrevPage: () => { + const currentState = this.store.store.getState(); + this.store.goToPage(currentState.pagination.page - 1); + }, + onNextPage: () => { + const currentState = this.store.store.getState(); + this.store.goToPage(currentState.pagination.page + 1); + }, onGoToPage: (page) => this.store.goToPage(page), onLikeComment: (commentId, isLike) => { if (this.store && typeof this.store.likeComment === 'function') {