mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 16:04:23 +00:00
Remove close confirmation
This commit is contained in:
@@ -96,14 +96,9 @@ const Settings = ({ visible, onClose }) => {
|
|||||||
|
|
||||||
const handleClose = useCallback(() => {
|
const handleClose = useCallback(() => {
|
||||||
if (state.hasUnsavedChanges) {
|
if (state.hasUnsavedChanges) {
|
||||||
const confirmClose = window.confirm(
|
updateTheme(state.initialSettings.theme); // Revert theme if not saved
|
||||||
'You have unsaved changes. Are you sure you want to close without saving?'
|
dispatch({ type: 'RESET' });
|
||||||
);
|
onClose();
|
||||||
if (confirmClose) {
|
|
||||||
updateTheme(state.initialSettings.theme); // Revert theme if not saved
|
|
||||||
dispatch({ type: 'RESET' });
|
|
||||||
onClose();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
onClose();
|
onClose();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user