Add migrated prefix to imported legacy instructs

ece268400143bccfe88ddae5958f49b9dadcf946

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

1 files changed, +5 -4Ignore whitespace
public/scripts/sysprompt.js+5 -4
@@ -72,14 +72,15 @@ export async function checkForSystemPromptInInstructTemplate(name, template) {
7272 if (!template || !name || typeof name !== 'string' || typeof template !== 'object') {
7373 return;
7474 }
7575 if ('system_prompt' in template && template.system_prompt && !system_prompts.some(x => x.name === name)) {
7676 const html = await renderTemplateAsync('migrateInstructPrompt', { prompt: template.system_prompt });
7777 const confirm = await callGenericPopup(html, POPUP_TYPE.CONFIRM);
7878 if (confirm) {
79- const prompt = { name: name, content: template.system_prompt };
79+ const migratedName = `[Migrated] ${name}`;
80+ const prompt = { name: migratedName, content: template.system_prompt };
8081 const presetManager = getPresetManager('sysprompt');
8182 await presetManager.savePreset(prompt.namemigratedName, prompt);
8283 toastr.success(`System prompt "${prompt.namemigratedName}" has been saved.`);
8384 } else {
8485 toastr.info('System prompt has been discarded.');
8586 }