From a067e81cce056d29c7cdefd52844be766bc0eda3 Mon Sep 17 00:00:00 2001 From: Joao Victor Date: Thu, 10 Mar 2022 16:08:26 -0300 Subject: [PATCH 1/3] Fix toast notification for 'Current presentation' --- .../imports/ui/components/common/toast/styles.js | 2 +- .../imports/ui/stylesheets/styled-components/globalStyles.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/common/toast/styles.js b/bigbluebutton-html5/imports/ui/components/common/toast/styles.js index f4d41e4f35..38e00686d0 100644 --- a/bigbluebutton-html5/imports/ui/components/common/toast/styles.js +++ b/bigbluebutton-html5/imports/ui/components/common/toast/styles.js @@ -180,7 +180,7 @@ const Toast = styled.div` const ToastifyContainer = styled(Toastify)` z-index: 9998; position: fixed; - padding: ${smPaddingY}; + /* padding: ${smPaddingY}; */ min-width: 20rem !important; max-width: 23rem !important; box-sizing: border-box; diff --git a/bigbluebutton-html5/imports/ui/stylesheets/styled-components/globalStyles.js b/bigbluebutton-html5/imports/ui/stylesheets/styled-components/globalStyles.js index 38031466bd..c9cb8b69d0 100644 --- a/bigbluebutton-html5/imports/ui/stylesheets/styled-components/globalStyles.js +++ b/bigbluebutton-html5/imports/ui/stylesheets/styled-components/globalStyles.js @@ -143,6 +143,9 @@ const GlobalStyle = createGlobalStyle` .actionToast { background-color: ${colorWhite}; + display: flex; + padding: ${smPaddingX}; + border-radius: ${borderRadius}; i.close { left: none !important; From 30826dfdd85de199c02a5f43702366ce11782a9b Mon Sep 17 00:00:00 2001 From: Joao Victor Date: Fri, 11 Mar 2022 09:36:56 -0300 Subject: [PATCH 2/3] Remove comment and unused import --- .../imports/ui/components/common/toast/styles.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/common/toast/styles.js b/bigbluebutton-html5/imports/ui/components/common/toast/styles.js index 38e00686d0..9644ae3fa5 100644 --- a/bigbluebutton-html5/imports/ui/components/common/toast/styles.js +++ b/bigbluebutton-html5/imports/ui/components/common/toast/styles.js @@ -27,7 +27,6 @@ import { borderSizeSmall, toastIconMd, toastIconSm, - smPaddingY, jumboPaddingY, } from '/imports/ui/stylesheets/styled-components/general'; import { smallOnly } from '/imports/ui/stylesheets/styled-components/breakpoints'; @@ -180,7 +179,6 @@ const Toast = styled.div` const ToastifyContainer = styled(Toastify)` z-index: 9998; position: fixed; - /* padding: ${smPaddingY}; */ min-width: 20rem !important; max-width: 23rem !important; box-sizing: border-box; From 41237ae0a0ba9e5aba134b2476e4f34cedc5bc4e Mon Sep 17 00:00:00 2001 From: Joao Victor Date: Fri, 11 Mar 2022 11:57:43 -0300 Subject: [PATCH 3/3] Fix notification not displaying --- .../ui/components/presentation/component.jsx | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx index 86c27fb661..46638c4c45 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/component.jsx @@ -175,27 +175,14 @@ class Presentation extends PureComponent { politeSRAlert(intl.formatMessage(intlMessages.slideContentChanged, { 0: currentSlide.num })); } - if (prevProps?.slidePosition && slidePosition) { - const { width: prevWidth, height: prevHeight } = prevProps.slidePosition; - const { width: currWidth, height: currHeight } = slidePosition; - - if (prevWidth !== currWidth || prevHeight !== currHeight) { - layoutContextDispatch({ - type: ACTIONS.SET_PRESENTATION_CURRENT_SLIDE_SIZE, - value: { - width: currWidth, - height: currHeight, - }, - }); - } - - const downloadableOn = !prevProps.currentPresentation.downloadable + if (currentPresentation) { + const downloadableOn = !prevProps?.currentPresentation?.downloadable && currentPresentation.downloadable; const shouldCloseToast = !(currentPresentation.downloadable && !userIsPresenter); if ( - prevProps.currentPresentation.name !== currentPresentation.name + prevProps?.currentPresentation?.name !== currentPresentation.name || (downloadableOn && !userIsPresenter) ) { if (this.currentPresentationToastId) { @@ -212,7 +199,7 @@ class Presentation extends PureComponent { } } - const downloadableOff = prevProps.currentPresentation.downloadable + const downloadableOff = prevProps?.currentPresentation?.downloadable && !currentPresentation.downloadable; if (this.currentPresentationToastId && downloadableOff) { @@ -221,6 +208,21 @@ class Presentation extends PureComponent { render: this.renderCurrentPresentationToast(), }); } + } + + if (prevProps?.slidePosition && slidePosition) { + const { width: prevWidth, height: prevHeight } = prevProps.slidePosition; + const { width: currWidth, height: currHeight } = slidePosition; + + if (prevWidth !== currWidth || prevHeight !== currHeight) { + layoutContextDispatch({ + type: ACTIONS.SET_PRESENTATION_CURRENT_SLIDE_SIZE, + value: { + width: currWidth, + height: currHeight, + }, + }); + } if (layoutSwapped && restoreOnUpdate && !userIsPresenter && currentSlide) { const slideChanged = currentSlide.id !== prevProps.currentSlide.id;