From edfdc1d57f0159ac1097ae909c09be74505b5fc4 Mon Sep 17 00:00:00 2001 From: Alexis G Date: Mon, 25 Mar 2024 18:50:07 +0100 Subject: [PATCH] fix(Viewer): Remove WebviewIntentProvider In commit 97f28ff, WebviewIntentProvider has been added to ViewerContainer, in order to call intent's methods in the container children. This is not needed because we expect the webapp to implemented on the root level. Also, this would produce a bug because WebviewIntentProvider is not mean to be declared twice in a same webapp. When doing so, the child WebviewIntentProvider would overwrite the parent one on the flagship app side. So when opening the Viewer, the parent provider would stop working. --- react/Viewer/ViewerContainer.jsx | 58 +++++++++++++++----------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/react/Viewer/ViewerContainer.jsx b/react/Viewer/ViewerContainer.jsx index 5497209bd..c22e6abe6 100644 --- a/react/Viewer/ViewerContainer.jsx +++ b/react/Viewer/ViewerContainer.jsx @@ -2,8 +2,6 @@ import React, { createRef } from 'react' import PropTypes from 'prop-types' import cx from 'classnames' -import { WebviewIntentProvider } from 'cozy-intent' - import useBreakpoints from '../providers/Breakpoints' import { FileDoctype } from '../proptypes' import { useExtendI18n } from '../providers/I18n' @@ -52,39 +50,37 @@ const ViewerContainer = props => { } return ( - - - -
- - - {children} - - - + +
+ + {children} - -
-
- - + + + + {children} + +
+
+
) }