Use UUIDv4 for profile IDs
| @@ -2,6 +2,7 @@ import { main_api, saveSettingsDebounced } from '../../../script.js'; | ||
| 2 | 2 | import { extension_settings, renderExtensionTemplateAsync } from '../../extensions.js'; |
| 3 | 3 | import { callGenericPopup, Popup, POPUP_TYPE } from '../../popup.js'; |
| 4 | 4 | import { executeSlashCommandsWithOptions } from '../../slash-commands.js'; |
| 5 | +import { uuidv4 } from '../../utils.js'; | |
| 5 | 6 | |
| 6 | 7 | const MODULE_NAME = 'connection-manager'; |
| 7 | 8 | |
| @@ -96,7 +97,7 @@ async function readProfileFromCommands(mode, profile, cleanUp = false) { | ||
| 96 | 97 | */ |
| 97 | 98 | async function createConnectionProfile() { |
| 98 | 99 | const mode = main_api === 'openai' ? 'cc' : 'tc'; |
| 99 | - const id = 'profile-' + Math.random().toString(36).substring(2); | |
| 100 | + const id = uuidv4(); | |
| 100 | 101 | const profile = { |
| 101 | 102 | id, |
| 102 | 103 | mode, |