mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[ide-react] Notify about unsaved changes (#16163)
* Notify about unsaved changes * Move system message components and types to shared folder * Add system messages component GitOrigin-RevId: ab81a24888847bd9a8a390fd1af6b58f471f7a4b
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
import { useConnectionContext } from '@/features/ide-react/context/connection-context'
|
||||
import { useModalsContext } from '@/features/ide-react/context/modals-context'
|
||||
|
||||
export const useConnectionState = () => {
|
||||
const { connectionState } = useConnectionContext()
|
||||
const { showLockEditorMessageModal } = useModalsContext()
|
||||
|
||||
// Show modal when editor is forcefully disconnected
|
||||
useEffect(() => {
|
||||
if (connectionState.forceDisconnected) {
|
||||
showLockEditorMessageModal(connectionState.forcedDisconnectDelay)
|
||||
}
|
||||
}, [
|
||||
connectionState.forceDisconnected,
|
||||
connectionState.forcedDisconnectDelay,
|
||||
showLockEditorMessageModal,
|
||||
])
|
||||
}
|
||||
Reference in New Issue
Block a user