fix(whiteboard): check before manipulating pan tool class list

Since the pan tool is only available for the presenter, it has to be checked
whether it actually exists before attempting to modify its class list.
This commit is contained in:
Arthurk12 2024-02-16 15:56:07 -03:00
parent 31537b1910
commit 49c33b4eea

View File

@ -145,9 +145,12 @@ export default function Whiteboard(props) {
} else { } else {
setIsPanning(false); setIsPanning(false);
setPanSelected(false); setPanSelected(false);
if (panButton) {
// only presenter has the pan button
panButton.classList.add('selectOverride'); panButton.classList.add('selectOverride');
panButton.classList.remove('select'); panButton.classList.remove('select');
} }
}
}; };
const setDockPosition = (setSetting) => { const setDockPosition = (setSetting) => {