@@ -74,6 +74,7 @@ export const EditBackupConfigComponent = ({
7474 const [ isShowCreateStorage , setShowCreateStorage ] = useState ( false ) ;
7575
7676 const [ isShowWarn , setIsShowWarn ] = useState ( false ) ;
77+ const [ isShowBackupDisableConfirm , setIsShowBackupDisableConfirm ] = useState ( false ) ;
7778
7879 const timeFormat = useMemo ( ( ) => {
7980 const is12 = getUserTimeFormat ( ) ;
@@ -206,7 +207,14 @@ export const EditBackupConfigComponent = ({
206207 < div className = "min-w-[150px]" > Backups enabled</ div >
207208 < Switch
208209 checked = { backupConfig . isBackupsEnabled }
209- onChange = { ( checked ) => updateBackupConfig ( { isBackupsEnabled : checked } ) }
210+ onChange = { ( checked ) => {
211+ // If disabling backups on existing database, show confirmation
212+ if ( ! checked && database . id && backupConfig . isBackupsEnabled ) {
213+ setIsShowBackupDisableConfirm ( true ) ;
214+ } else {
215+ updateBackupConfig ( { isBackupsEnabled : checked } ) ;
216+ }
217+ } }
210218 size = "small"
211219 />
212220 </ div >
@@ -517,6 +525,22 @@ export const EditBackupConfigComponent = ({
517525 hideCancelButton
518526 />
519527 ) }
528+
529+ { isShowBackupDisableConfirm && (
530+ < ConfirmationComponent
531+ onConfirm = { ( ) => {
532+ updateBackupConfig ( { isBackupsEnabled : false } ) ;
533+ setIsShowBackupDisableConfirm ( false ) ;
534+ } }
535+ onDecline = { ( ) => {
536+ setIsShowBackupDisableConfirm ( false ) ;
537+ } }
538+ description = "All current backups will be removed? Are you sure?"
539+ actionButtonColor = "red"
540+ actionText = "Yes, disable backing up and remove all existing backup files"
541+ cancelText = "Cancel"
542+ />
543+ ) }
520544 </ div >
521545 ) ;
522546} ;
0 commit comments