Skip to content

Commit

Permalink
fix: object menu pin/unpin state
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbcool committed Aug 19, 2021
1 parent f62b568 commit 1fc970e
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 1fc970e

Please sign in to comment.