+
- scrollToPage(this.newPageId))
// Parents location changes when the first subpage is created.
- this.dispatchGetPages()
+ this.dispatchGetPages(false)
} catch (e) {
console.error(e)
showError(t('collectives', 'Could not create the page'))
@@ -139,14 +139,14 @@ export default {
// Move subpage to new parent
try {
- this.load('page')
+ this.load('currentPage')
await this.dispatchMovePage({ newParentId, pageId, index: newIndex })
} catch (e) {
console.error(e)
showError(t('collectives', 'Could not move page'))
return
} finally {
- this.done('page')
+ this.done('currentPage')
}
// Redirect to new page path if currentPage got moved
diff --git a/src/store/circles.js b/src/store/circles.js
index 420e60305..37f54cf88 100644
--- a/src/store/circles.js
+++ b/src/store/circles.js
@@ -80,7 +80,7 @@ export default {
if (collective.id === getters.currentCollective?.id) {
// Update page list, properties like `collectivePath` might have changed
- await dispatch(GET_PAGES)
+ await dispatch(GET_PAGES, false)
await dispatch(GET_TRASH_PAGES)
}
commit(PATCH_COLLECTIVE_WITH_CIRCLE, response.data.ocs.data)
diff --git a/src/store/pages.js b/src/store/pages.js
index cdbd64dbf..07aeb7ce7 100644
--- a/src/store/pages.js
+++ b/src/store/pages.js
@@ -506,10 +506,8 @@ export default {
* @param {number} pageId Page ID
*/
async [GET_PAGE]({ commit, getters, state }, { parentId, pageId }) {
- commit('load', 'page')
const response = await axios.get(getters.pageUrl(parentId, pageId))
commit(UPDATE_PAGE, response.data.data)
- commit('done', 'page')
},
/**
@@ -572,12 +570,10 @@ export default {
* @param {string} newTitle new title for the page
*/
async [RENAME_PAGE]({ commit, getters }, newTitle) {
- commit('load', 'page')
const page = getters.currentPage
const url = getters.pageUrl(page.parentId, page.id)
const response = await axios.put(url, { title: newTitle })
await commit(UPDATE_PAGE, response.data.data)
- commit('done', 'page')
},
/**
@@ -693,10 +689,8 @@ export default {
* @param {number} page.pageId ID of the page
*/
async [TRASH_PAGE]({ commit, getters }, { parentId, pageId }) {
- commit('load', 'page')
const response = await axios.delete(getters.pageUrl(parentId, pageId))
commit(MOVE_PAGE_INTO_TRASH, response.data.data)
- commit('done', 'page')
},
/**