fix: userdata-force_restore_presentation_on_new_events (#20974)

This commit is contained in:
João Victor Nunes 2024-08-20 13:29:04 -03:00 committed by GitHub
parent a0fb450522
commit 3ad9aafd7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,6 +45,10 @@ import {
} from '../presentation/mutations';
import { useMergedCursorData } from './hooks.ts';
import useDeduplicatedSubscription from '../../core/hooks/useDeduplicatedSubscription';
import MediaService from '/imports/ui/components/media/service';
import getFromUserSettings from '/imports/ui/services/users-settings';
const FORCE_RESTORE_PRESENTATION_ON_NEW_EVENTS = 'bbb_force_restore_presentation_on_new_events';
const WhiteboardContainer = (props) => {
const {
@ -53,6 +57,7 @@ const WhiteboardContainer = (props) => {
} = props;
const WHITEBOARD_CONFIG = window.meetingClientSettings.public.whiteboard;
const layoutContextDispatch = layoutDispatch();
const [annotations, setAnnotations] = useState([]);
const [shapes, setShapes] = useState({});
@ -223,6 +228,17 @@ const WhiteboardContainer = (props) => {
);
setAnnotations([...currentAnnotations, ...newAnnotations]);
if (newAnnotations.length) {
const restoreOnUpdate = getFromUserSettings(
FORCE_RESTORE_PRESENTATION_ON_NEW_EVENTS,
window.meetingClientSettings.public.presentation.restoreOnUpdate,
);
if (restoreOnUpdate) {
MediaService.setPresentationIsOpen(layoutContextDispatch, true);
}
}
};
React.useEffect(() => {
@ -281,7 +297,6 @@ const WhiteboardContainer = (props) => {
colorStyle, dashStyle, fillStyle, fontStyle, sizeStyle,
} = WHITEBOARD_CONFIG.styles;
const handleToggleFullScreen = (ref) => FullscreenService.toggleFullScreen(ref);
const layoutContextDispatch = layoutDispatch();
bgShape.push({
x: 1,