cfa013fdaa
The client may crash whenever a emoji rain animation is triggered, but the interactions button element cannot be located. This happens because the button coordinates are fetched without checking whether the element exists. Get the coordinate fetching method to return null if the interactionsButton element cannot be located, and ignore the emoji rain action if that is the case. Whenever no valid coordinates are found, log an warning so we can track this and figure out what's happening with the button. Fix a few typos in the getInteractionsButtonCoordinates method.
14 lines
266 B
JavaScript
14 lines
266 B
JavaScript
const getInteractionsButtonCoordinates = () => {
|
|
const el = document.getElementById('interactionsButton');
|
|
|
|
if (!el) return null;
|
|
|
|
const coordinate = el.getBoundingClientRect();
|
|
|
|
return coordinate;
|
|
};
|
|
|
|
export default {
|
|
getInteractionsButtonCoordinates,
|
|
};
|