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,8 +145,11 @@ export default function Whiteboard(props) {
} else {
setIsPanning(false);
setPanSelected(false);
panButton.classList.add('selectOverride');
panButton.classList.remove('select');
if (panButton) {
// only presenter has the pan button
panButton.classList.add('selectOverride');
panButton.classList.remove('select');
}
}
};