Skip to content

Commit

Permalink
Change: ブックマーク分類のページネーション (#123)
Browse files Browse the repository at this point in the history
* Change: ブックマーク分類の投稿一覧のページネーション対応

* Fix: `console.dir`を削除(なぜ警告出ない)
  • Loading branch information
kmycode authored Oct 16, 2023
1 parent d0f0dd7 commit 86a8b26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app/javascript/mastodon/actions/bookmark_categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ export const deleteBookmarkCategoryFail = (id, error) => ({
export const fetchBookmarkCategoryStatuses = bookmarkCategoryId => (dispatch, getState) => {
dispatch(fetchBookmarkCategoryStatusesRequest(bookmarkCategoryId));

api(getState).get(`/api/v1/bookmark_categories/${bookmarkCategoryId}/statuses`, { params: { limit: 0 } }).then(({ data }) => {
dispatch(importFetchedStatuses(data));
dispatch(fetchBookmarkCategoryStatusesSuccess(bookmarkCategoryId, data));
api(getState).get(`/api/v1/bookmark_categories/${bookmarkCategoryId}/statuses`).then((response) => {
const next = getLinks(response).refs.find(link => link.rel === 'next');
dispatch(importFetchedStatuses(response.data));
dispatch(fetchBookmarkCategoryStatusesSuccess(bookmarkCategoryId, response.data, next ? next.uri : null));
}).catch(err => dispatch(fetchBookmarkCategoryStatusesFail(bookmarkCategoryId, err)));
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class BookmarkCategoryStatuses extends ImmutablePureComponent {
};

handleLoadMore = debounce(() => {
this.props.dispatch(expandBookmarkCategoryStatuses());
this.props.dispatch(expandBookmarkCategoryStatuses(this.props.params.id));
}, 300, { leading: true });

render () {
Expand Down

0 comments on commit 86a8b26

Please sign in to comment.