Skip to content

Commit

Permalink
Merge pull request #4544 from mozilla/fix-object-menu-pin-state
Browse files Browse the repository at this point in the history
fix: object menu pin/unpin state
  • Loading branch information
matthewbcool authored Aug 24, 2021
2 parents 4a9e201 + 1fc970e commit 727b2b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/react-components/room/object-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ export function usePinObject(hubChannel, scene, object) {
function onPinStateChanged() {
setIsPinned(getPinnedState(el));
}

el.addEventListener("pinned", onPinStateChanged);
el.addEventListener("unpinned", onPinStateChanged);

setIsPinned(getPinnedState(el));
return () => {
el.removeEventListener("pinned", onPinStateChanged);
el.removeEventListener("unpinned", onPinStateChanged);
Expand Down

0 comments on commit 727b2b2

Please sign in to comment.