Skip to content

Commit

Permalink
fix(Dataset): paging bug on dataset files visualization removed (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilian-delouvy authored Jan 7, 2022
1 parent de2a309 commit ce14399
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Ml.Cli.WebApp/ClientApp/src/Server/Dataset/Edit/FileList.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ const FileList = ({state, setState}) => {
};

const onChangePaging = ({numberItems, page}) => {
console.log(numberItems, page)
const newNumberPages = computeNumberPages(state.filesSend, numberItems);
const newCurrentPage = state.paging.currentPages > newNumberPages ? newNumberPages : page
setState({...state,
paging: {
itemByPages: numberItems,
currentPages: page,
itemFiltered: filterPaging(state.filesSend, numberItems, page),
numberPages: computeNumberPages(state.filesSend, numberItems)}
})
currentPages: newCurrentPage,
itemFiltered: filterPaging(state.filesSend, numberItems, newCurrentPage),
numberPages: newNumberPages
}});
};

return (
Expand Down

0 comments on commit ce14399

Please sign in to comment.