mirror of
https://github.com/sasjs/server.git
synced 2026-01-04 21:30:05 +00:00
feat: prevent user from leaving studio page when there are unsaved changes
This commit is contained in:
@@ -39,6 +39,8 @@ import FilePathInputModal from '../../components/filePathInputModal'
|
||||
import BootstrapSnackbar, { AlertSeverityType } from '../../components/snackbar'
|
||||
import Modal from '../../components/modal'
|
||||
|
||||
import usePrompt from '../../utils/usePrompt'
|
||||
|
||||
const StyledTabPanel = styled(TabPanel)(() => ({
|
||||
padding: '10px'
|
||||
}))
|
||||
@@ -98,6 +100,11 @@ const SASjsEditor = ({
|
||||
diffEditorRef.current = diffEditor
|
||||
}
|
||||
|
||||
usePrompt(
|
||||
'Changes you made may not be saved.',
|
||||
prevFileContent !== fileContent
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
setRunTimes(Object.values(appContext.runTimes))
|
||||
}, [appContext.runTimes])
|
||||
|
||||
Reference in New Issue
Block a user