MCPcopy Create free account
hub / github.com/SplootCode/splootcode / checkVersion

Function checkVersion

packages/editor/src/components/autosave_info.tsx:18–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 useEffect(() => {
17 if (!editorState?.project.isReadOnly) {
18 const checkVersion = async () => {
19 if (document['hidden'] === false) {
20 const isCurrent = await editorState.autosaveWatcher.projectLoader.isCurrentVersion(editorState?.project)
21 if (!isCurrent) {
22 reloadProject()
23 }
24 }
25 }
26 window.addEventListener('visibilitychange', checkVersion)
27 return () => {
28 window.removeEventListener('visibilitychange', checkVersion)

Callers

nothing calls this directly

Calls 1

isCurrentVersionMethod · 0.80

Tested by

no test coverage detected