mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix old name prepopulate, run formatter
This commit is contained in:
@@ -739,7 +739,8 @@ async function waitForConnection() {
|
||||
export async function initPresetManager() {
|
||||
eventSource.on(event_types.CHAT_CHANGED, autoSelectPreset);
|
||||
registerPresetManagers();
|
||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'preset',
|
||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||
name: 'preset',
|
||||
callback: presetCommandCallback,
|
||||
returns: 'current preset',
|
||||
unnamedArgumentList: [
|
||||
@@ -802,9 +803,9 @@ export async function initPresetManager() {
|
||||
}
|
||||
|
||||
const popupHeader = !presetManager.isAdvancedFormatting() ? t`Rename preset` : t`Rename template`;
|
||||
const oldName = name;
|
||||
const oldName = presetManager.getSelectedPresetName();
|
||||
const newName = await Popup.show.input(popupHeader, t`Enter a new name:`, oldName);
|
||||
if (oldName === newName || !newName) {
|
||||
if (!newName || oldName === newName) {
|
||||
console.debug(!presetManager.isAdvancedFormatting() ? 'Preset rename cancelled' : 'Template rename cancelled');
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user