Fix import of presets with spaces

This commit is contained in:
Cohee 2023-10-16 20:01:45 +03:00
parent 59af85ce1c
commit 4f458ce93a
1 changed files with 3 additions and 1 deletions

View File

@ -382,8 +382,10 @@ jQuery(async () => {
return;
}
const name = file.name.replace('.json', '').replace('.settings', '');
const fileName = file.name.replace('.json', '').replace('.settings', '');
const data = await parseJsonFile(file);
const name = data?.name ?? fileName;
data['name'] = name;
await presetManager.savePreset(name, data);
toastr.success('Preset imported');