diff --git a/addons/website/static/src/components/dialog/add_page_dialog.js b/addons/website/static/src/components/dialog/add_page_dialog.js index 783344168e1..ec29a2d9a07 100644 --- a/addons/website/static/src/components/dialog/add_page_dialog.js +++ b/addons/website/static/src/components/dialog/add_page_dialog.js @@ -362,9 +362,6 @@ export class AddPageDialog extends Component { this.userService = useService('user'); this.cssLinkEls = undefined; - if (this.props.ready) { - onMounted(() => this.props.ready()); - } this.lastTabName = ""; useSubEnv({ @@ -417,10 +414,6 @@ AddPageDialog.props = { type: Function, optional: true, }, - ready: { - type: Function, - optional: true, - }, websiteId: { type: Number, }, diff --git a/addons/website/static/src/components/views/page_views_mixin.js b/addons/website/static/src/components/views/page_views_mixin.js index a394930981d..efac083c490 100644 --- a/addons/website/static/src/components/views/page_views_mixin.js +++ b/addons/website/static/src/components/views/page_views_mixin.js @@ -41,14 +41,8 @@ export const PageControllerMixin = (component) => class extends component { */ async createWebsiteContent() { if (this.props.resModel === 'website.page') { - if (this.isCreatingNewPage) { - // Prevent opening the "New page" dialog several times. - return; - } - this.isCreatingNewPage = true; return this.dialog.add(AddPageDialog, { websiteId: this.state.activeWebsite.id, - ready: () => this.isCreatingNewPage = false, }); } const action = this.props.context.create_action; diff --git a/addons/website/static/src/systray_items/new_content.js b/addons/website/static/src/systray_items/new_content.js index 607c5e2be68..28c0af923d3 100644 --- a/addons/website/static/src/systray_items/new_content.js +++ b/addons/website/static/src/systray_items/new_content.js @@ -171,15 +171,9 @@ export class NewContentModal extends Component { } createNewPage() { - if (this.isCreatingNewPage) { - // Prevent opening the "New page" dialog several times. - return; - } - this.isCreatingNewPage = true; this.dialogs.add(AddPageDialog, { onAddPage: () => this.websiteContext.showNewContentModal = false, websiteId: this.website.currentWebsite.id, - ready: () => this.isCreatingNewPage = false, }); }