Merge pull request #18267 from KDSBrowne/bbb-18231
fix: Whiteboard Crash When Switching Between Zoomed-In Slides
This commit is contained in:
commit
4b232b62a0
@ -528,9 +528,9 @@ export default function Whiteboard(props) {
|
||||
// Reset zoom to default when current presentation changes.
|
||||
React.useEffect(() => {
|
||||
if (isPresenter && slidePosition && tldrawAPI) {
|
||||
tldrawAPI.zoomTo(0);
|
||||
tldrawAPI?.zoomTo(0);
|
||||
setHistory(null);
|
||||
tldrawAPI.resetHistory();
|
||||
tldrawAPI?.resetHistory();
|
||||
}
|
||||
}, [curPres?.id]);
|
||||
|
||||
@ -930,8 +930,8 @@ export default function Whiteboard(props) {
|
||||
|
||||
if (command && command?.id?.includes('change_page')) {
|
||||
const camera = tldrawAPI?.getPageState()?.camera;
|
||||
if (currentCameraPoint[app?.currentPageId]) {
|
||||
tldrawAPI?.setCamera([currentCameraPoint[app?.currentPageId][0], currentCameraPoint[app?.currentPageId][1]], camera.zoom);
|
||||
if (currentCameraPoint[app?.currentPageId] && camera) {
|
||||
tldrawAPI?.setCamera([currentCameraPoint[app?.currentPageId][0], currentCameraPoint[app?.currentPageId][1]], camera?.zoom);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user