Skip to content

Commit

Permalink
U dont break me, before Im done
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Aug 7, 2023
1 parent e732887 commit 973f70d
Show file tree
Hide file tree
Showing 2 changed files with 15,465 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/pages/Devices/EditVirtuals/EditVirtuals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ export default function EditVirtuals({
}
}, [virtual?.id, open])

useEffect(() => {
const unloadCallback = (event: any) => {
event.preventDefault()
if (virtual?.id) calibrationMode(virtual?.id, 'off')
return ''
}

window.addEventListener('beforeunload', unloadCallback)
return () => window.removeEventListener('beforeunload', unloadCallback)
}, [])

return virtual && virtual.config ? (
<>
{type === 'menuItem' ? (
Expand Down
Loading

0 comments on commit 973f70d

Please sign in to comment.