MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / handlePopState

Function handlePopState

src/hooks/useUrlState.ts:169–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167 // Handle browser back/forward (popstate)
168 useEffect(() => {
169 const handlePopState = async () => {
170 const state = await decodeCameraStateFromHash(window.location.hash);
171 if (state) {
172 flyToState(state);
173 lastEncodedState.current = encodeCameraState(state);
174 }
175 };
176
177 window.addEventListener('popstate', handlePopState);
178 return () => window.removeEventListener('popstate', handlePopState);

Callers

nothing calls this directly

Calls 2

encodeCameraStateFunction · 0.90

Tested by

no test coverage detected