MCPcopy Create free account
hub / github.com/winfunc/opcode / handleBeforeUnload

Function handleBeforeUnload

src/contexts/TabContext.tsx:125–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123 // Save tabs immediately when window is about to close
124 useEffect(() => {
125 const handleBeforeUnload = () => {
126 if (isInitialized.current && tabs.length > 0) {
127 TabPersistenceService.saveTabs(tabs, activeTabId);
128 }
129 };
130
131 window.addEventListener('beforeunload', handleBeforeUnload);
132

Callers

nothing calls this directly

Calls 1

saveTabsMethod · 0.80

Tested by

no test coverage detected