diff --git a/src/react-components/room/object-hooks.js b/src/react-components/room/object-hooks.js index ea8c0a6b61..fb63078772 100644 --- a/src/react-components/room/object-hooks.js +++ b/src/react-components/room/object-hooks.js @@ -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);