Skip to content

Commit

Permalink
Fix Move to top of folder ordering in folder content view (#4691) (#4699
Browse files Browse the repository at this point in the history
)

Co-authored-by: Alok Kumar <ialokkumarsingh0@gmail.com>
  • Loading branch information
sneridagh and iFlameing authored Apr 14, 2023
1 parent 5858318 commit 4f38726
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions news/4690.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix Move to top of folder ordering in folder content view @iFlameing
25 changes: 14 additions & 11 deletions src/components/manage/Contents/Contents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -797,17 +797,20 @@ class Contents extends Component {
onMoveToTop(event, { value }) {
const id = this.state.items[value]['@id'];
value = this.state.currentPage * this.state.pageSize + value;
this.props.orderContent(
getBaseUrl(this.props.pathname),
id.replace(/^.*\//, ''),
-value,
);
this.setState(
{
currentPage: 0,
},
() => this.fetchContents(),
);
this.props
.orderContent(
getBaseUrl(this.props.pathname),
id.replace(/^.*\//, ''),
-value,
)
.then(() => {
this.setState(
{
currentPage: 0,
},
() => this.fetchContents(),
);
});
}

/**
Expand Down

0 comments on commit 4f38726

Please sign in to comment.