| 72 | 72 | if (!template || !name || typeof name !== 'string' || typeof template !== 'object') { |
| 73 | 73 | return; |
| 74 | 74 | } |
| 75 | 75 | if ('system_prompt' in template && template.system_prompt && !system_prompts.some(x => x.name === name)) { |
| 76 | 76 | const html = await renderTemplateAsync('migrateInstructPrompt', { prompt: template.system_prompt }); |
| 77 | 77 | const confirm = await callGenericPopup(html, POPUP_TYPE.CONFIRM); |
| 78 | 78 | 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 }; |
| 80 | 81 | const presetManager = getPresetManager('sysprompt'); |
| 81 | 82 | await presetManager.savePreset(prompt.namemigratedName, prompt); |
| 82 | 83 | toastr.success(`System prompt "${prompt.namemigratedName}" has been saved.`); |
| 83 | 84 | } else { |
| 84 | 85 | toastr.info('System prompt has been discarded.'); |
| 85 | 86 | } |