Skip to content

Commit

Permalink
fixes #6837 and fixes #6838
Browse files Browse the repository at this point in the history
  • Loading branch information
night committed Jun 1, 2024
1 parent cbaa15b commit 39c4668
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/modules/emote_menu/components/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ export default function Button({

if (loaded || emoteMenuViewStore.isLoaded()) {
callback();
return null;
return;
}

const removeListener = emoteMenuViewStore.once('updated', callback);
// eslint-disable-next-line consistent-return
return () => {
removeListener();
};
Expand Down
3 changes: 2 additions & 1 deletion src/modules/emote_menu/hooks/HorizontalResize.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function useHorizontalResize({boundingQuerySelector, handleRef, r
React.useEffect(() => {
const currentRef = handleRef.current;
if (currentRef == null) {
return null;
return;
}

function handleWindowResize() {
Expand All @@ -57,6 +57,7 @@ export default function useHorizontalResize({boundingQuerySelector, handleRef, r
document.addEventListener('mouseup', handleResizeEnd);
window.addEventListener('resize', handleWindowResize);

// eslint-disable-next-line consistent-return
return () => {
currentRef.removeEventListener('mousedown', handleResizeStart);
document.addEventListener('mouseup', handleResizeEnd);
Expand Down

0 comments on commit 39c4668

Please sign in to comment.