mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@@ -36,7 +36,7 @@ import {
|
|||||||
textgenerationwebui_presets,
|
textgenerationwebui_presets,
|
||||||
textgenerationwebui_settings as textgen_settings,
|
textgenerationwebui_settings as textgen_settings,
|
||||||
} from './textgen-settings.js';
|
} from './textgen-settings.js';
|
||||||
import { download, equalsIgnoreCaseAndAccents, parseJsonFile, waitUntilCondition } from './utils.js';
|
import { download, equalsIgnoreCaseAndAccents, getSanitizedFilename, parseJsonFile, waitUntilCondition } from './utils.js';
|
||||||
import { t } from './i18n.js';
|
import { t } from './i18n.js';
|
||||||
import { reasoning_templates } from './reasoning.js';
|
import { reasoning_templates } from './reasoning.js';
|
||||||
|
|
||||||
@@ -891,7 +891,7 @@ export async function initPresetManager() {
|
|||||||
|
|
||||||
const popupHeader = !presetManager.isAdvancedFormatting() ? t`Rename preset` : t`Rename template`;
|
const popupHeader = !presetManager.isAdvancedFormatting() ? t`Rename preset` : t`Rename template`;
|
||||||
const oldName = presetManager.getSelectedPresetName();
|
const oldName = presetManager.getSelectedPresetName();
|
||||||
const newName = await Popup.show.input(popupHeader, t`Enter a new name:`, oldName);
|
const newName = await getSanitizedFilename(await Popup.show.input(popupHeader, t`Enter a new name:`, oldName) || '');
|
||||||
if (!newName || oldName === newName) {
|
if (!newName || oldName === newName) {
|
||||||
console.debug(!presetManager.isAdvancedFormatting() ? 'Preset rename cancelled' : 'Template rename cancelled');
|
console.debug(!presetManager.isAdvancedFormatting() ? 'Preset rename cancelled' : 'Template rename cancelled');
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user