|
|
@ -282,11 +282,15 @@ const ConfigList = ({rootConfig, setTotalConfigCountDiff}: {rootConfig: ConfigPr |
|
|
title="Delete" |
|
|
title="Delete" |
|
|
onClick={() => { |
|
|
onClick={() => { |
|
|
if(configPresetSelected.parent === undefined) { |
|
|
if(configPresetSelected.parent === undefined) { |
|
|
alert("-- cannot delete root --"); |
|
|
if(!confirm(`Are you sure you want to reset the preset list to default?`)) |
|
|
|
|
|
return; |
|
|
|
|
|
const newDefault = new ConfigPreset("Default"); |
|
|
|
|
|
setConfigPresetRoot(newDefault); |
|
|
|
|
|
newDefault.saveConfigTree(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
// TEMP: Replace with proper dialog.
|
|
|
// TEMP: Replace with proper dialog.
|
|
|
if(!confirm(`Are you sure you want to remove "${configPresetSelected.name}"?`)) |
|
|
if(!confirm(`Are you sure you want to remove "${configPresetSelected.name}" and all its children?`)) |
|
|
return; |
|
|
return; |
|
|
configPresetSelected.parent.children = configPresetSelected.parent.children.filter(c => c != configPresetSelected); |
|
|
configPresetSelected.parent.children = configPresetSelected.parent.children.filter(c => c != configPresetSelected); |
|
|
setConfigPresetSelected(configPresetSelected.parent); |
|
|
setConfigPresetSelected(configPresetSelected.parent); |
|
|
|