Skip to content

Commit

Permalink
Fix Move to top of folder ordering in folder content view
Browse files Browse the repository at this point in the history
  • Loading branch information
iFlameing committed Apr 13, 2023
1 parent c18898d commit cd85066
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 cd85066

Please sign in to comment.