Browse Source

Reset default config

pull/110/head
Malte Grimm 3 years ago
parent
commit
93125a2b2e
  1. 8
      src/components/Dashboard.tsx
  2. 2
      src/core/stores/appStore.ts

8
src/components/Dashboard.tsx

@ -282,11 +282,15 @@ const ConfigList = ({rootConfig, setTotalConfigCountDiff}: {rootConfig: ConfigPr
title="Delete"
onClick={() => {
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;
}
// 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;
configPresetSelected.parent.children = configPresetSelected.parent.children.filter(c => c != configPresetSelected);
setConfigPresetSelected(configPresetSelected.parent);

2
src/core/stores/appStore.ts

@ -148,7 +148,7 @@ export class ConfigPreset {
if(rootPreset !== undefined)
return rootPreset;
}
return new ConfigPreset("Root");
return new ConfigPreset("Default");
}
public static async importConfigTree() {

Loading…
Cancel
Save