From 067f9255a67bbfcaa32f75e1ca21400f04eb8410 Mon Sep 17 00:00:00 2001 From: std-odoo Date: Wed, 28 Jun 2023 06:36:35 +0000 Subject: [PATCH] [IMP] web: make the `close` props of FileViewer not required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Purpose ======= In the documents modules, we don't need to give the close props, and so instead of giving a dummy method, we make it non-required here. Task-3290796 closes odoo/odoo#126633 Related: odoo/enterprise#40441 Signed-off-by: Warnon Aurélien (awa) --- addons/web/static/src/core/file_viewer/file_viewer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/core/file_viewer/file_viewer.js b/addons/web/static/src/core/file_viewer/file_viewer.js index ceb12f2226e..f92156331d0 100644 --- a/addons/web/static/src/core/file_viewer/file_viewer.js +++ b/addons/web/static/src/core/file_viewer/file_viewer.js @@ -25,7 +25,7 @@ import { useService } from "@web/core/utils/hooks"; export class FileViewer extends Component { static template = "web.FileViewer"; static components = {}; - static props = ["files", "startIndex", "close", "modal?"]; + static props = ["files", "startIndex", "close?", "modal?"]; static defaultProps = { modal: true, }; @@ -64,7 +64,7 @@ export class FileViewer extends Component { } close() { - this.props.close(); + this.props.close && this.props.close(); } next() {