From cd85066d03358f6750dd577da1f7c1046e736c32 Mon Sep 17 00:00:00 2001 From: iFlameing Date: Thu, 13 Apr 2023 20:09:47 +0530 Subject: [PATCH] Fix Move to top of folder ordering in folder content view --- news/4690.bugfix | 1 + src/components/manage/Contents/Contents.jsx | 25 ++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 news/4690.bugfix diff --git a/news/4690.bugfix b/news/4690.bugfix new file mode 100644 index 0000000000..c7cd77a16e --- /dev/null +++ b/news/4690.bugfix @@ -0,0 +1 @@ +Fix Move to top of folder ordering in folder content view @iFlameing \ No newline at end of file diff --git a/src/components/manage/Contents/Contents.jsx b/src/components/manage/Contents/Contents.jsx index 744c794711..0e928dfc20 100644 --- a/src/components/manage/Contents/Contents.jsx +++ b/src/components/manage/Contents/Contents.jsx @@ -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(), + ); + }); } /**