Compare commits
2 Commits
472b08d0e5
...
9cf53c6a55
Author | SHA1 | Date |
---|---|---|
Cohee | 9cf53c6a55 | |
Wolfsblvt | 63512c208f |
|
@ -646,7 +646,12 @@ async function lockPersona() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
power_user.personas[user_avatar] = name1;
|
power_user.personas[user_avatar] = name1;
|
||||||
power_user.persona_descriptions[user_avatar] = { description: '', position: persona_description_positions.IN_PROMPT };
|
power_user.persona_descriptions[user_avatar] = {
|
||||||
|
description: '',
|
||||||
|
position: persona_description_positions.IN_PROMPT,
|
||||||
|
depth: DEFAULT_DEPTH,
|
||||||
|
role: DEFAULT_ROLE,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
chat_metadata['persona'] = user_avatar;
|
chat_metadata['persona'] = user_avatar;
|
||||||
|
@ -1012,7 +1017,7 @@ async function duplicatePersona(avatarId) {
|
||||||
const personaName = power_user.personas[avatarId];
|
const personaName = power_user.personas[avatarId];
|
||||||
|
|
||||||
if (!personaName) {
|
if (!personaName) {
|
||||||
toastr.warning('Current avatar is not a persona');
|
toastr.warning('Chosen avatar is not a persona');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1028,10 +1033,10 @@ async function duplicatePersona(avatarId) {
|
||||||
|
|
||||||
power_user.personas[newAvatarId] = personaName;
|
power_user.personas[newAvatarId] = personaName;
|
||||||
power_user.persona_descriptions[newAvatarId] = {
|
power_user.persona_descriptions[newAvatarId] = {
|
||||||
description: descriptor?.description || '',
|
description: descriptor?.description ?? '',
|
||||||
position: descriptor?.position || persona_description_positions.IN_PROMPT,
|
position: descriptor?.position ?? persona_description_positions.IN_PROMPT,
|
||||||
depth: descriptor?.depth || DEFAULT_DEPTH,
|
depth: descriptor?.depth ?? DEFAULT_DEPTH,
|
||||||
role: descriptor?.role || DEFAULT_ROLE,
|
role: descriptor?.role ?? DEFAULT_ROLE,
|
||||||
};
|
};
|
||||||
|
|
||||||
await uploadUserAvatar(getUserAvatar(avatarId), newAvatarId);
|
await uploadUserAvatar(getUserAvatar(avatarId), newAvatarId);
|
||||||
|
|
|
@ -73,8 +73,8 @@ const showPopupHelper = {
|
||||||
/**
|
/**
|
||||||
* Asynchronously displays an input popup with the given header and text, and returns the user's input.
|
* Asynchronously displays an input popup with the given header and text, and returns the user's input.
|
||||||
*
|
*
|
||||||
* @param {string} header - The header text for the popup.
|
* @param {string?} header - The header text for the popup.
|
||||||
* @param {string} text - The main text for the popup.
|
* @param {string?} text - The main text for the popup.
|
||||||
* @param {string} [defaultValue=''] - The default value for the input field.
|
* @param {string} [defaultValue=''] - The default value for the input field.
|
||||||
* @param {PopupOptions} [popupOptions={}] - Options for the popup.
|
* @param {PopupOptions} [popupOptions={}] - Options for the popup.
|
||||||
* @return {Promise<string?>} A Promise that resolves with the user's input.
|
* @return {Promise<string?>} A Promise that resolves with the user's input.
|
||||||
|
@ -591,15 +591,15 @@ class PopupUtils {
|
||||||
/**
|
/**
|
||||||
* Builds popup content with header and text below
|
* Builds popup content with header and text below
|
||||||
*
|
*
|
||||||
* @param {string} header - The header to be added to the text
|
* @param {string?} header - The header to be added to the text
|
||||||
* @param {string} text - The main text content
|
* @param {string?} text - The main text content
|
||||||
*/
|
*/
|
||||||
static BuildTextWithHeader(header, text) {
|
static BuildTextWithHeader(header, text) {
|
||||||
if (!header) {
|
if (!header) {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
return `<h3>${header}</h3>
|
return `<h3>${header}</h3>
|
||||||
${text}`;
|
${text ?? ''}`; // Convert no text to empty string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue