Sanitize filename before renaming Fixes #3982

8d84871134ec962e60fb01ebaedf7ac89bd0dc77

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -2Ignore whitespace
public/scripts/preset-manager.js+2 -2
@@ -36,7 +36,7 @@ import {
3636 textgenerationwebui_presets,
3737 textgenerationwebui_settings as textgen_settings,
3838} from './textgen-settings.js';
3939import { download, equalsIgnoreCaseAndAccents, getSanitizedFilename, parseJsonFile, waitUntilCondition } from './utils.js';
4040import { t } from './i18n.js';
4141import { reasoning_templates } from './reasoning.js';
4242
@@ -891,7 +891,7 @@ export async function initPresetManager() {
891891
892892 const popupHeader = !presetManager.isAdvancedFormatting() ? t`Rename preset` : t`Rename template`;
893893 const oldName = presetManager.getSelectedPresetName();
894894 const newName = await getSanitizedFilename(await Popup.show.input(popupHeader, t`Enter a new name:`, oldName) || '');
895895 if (!newName || oldName === newName) {
896896 console.debug(!presetManager.isAdvancedFormatting() ? 'Preset rename cancelled' : 'Template rename cancelled');
897897 return;