mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Confirm character duplication
This commit is contained in:
@ -3151,6 +3151,13 @@ async function DupeChar() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const confirm = await callPopup('Are you sure you want to duplicate this character?', 'confirm');
|
||||||
|
|
||||||
|
if (!confirm) {
|
||||||
|
console.log('User cancelled duplication');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const body = { avatar_url: characters[this_chid].avatar };
|
const body = { avatar_url: characters[this_chid].avatar };
|
||||||
const response = await fetch('/dupecharacter', {
|
const response = await fetch('/dupecharacter', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -8240,17 +8247,7 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#dupe_button").click(async function () {
|
$("#dupe_button").click(async function () {
|
||||||
|
await DupeChar();
|
||||||
const body = { avatar_url: characters[this_chid].avatar };
|
|
||||||
const response = await fetch('/dupecharacter', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: getRequestHeaders(),
|
|
||||||
body: JSON.stringify(body),
|
|
||||||
});
|
|
||||||
if (response.ok) {
|
|
||||||
toastr.success("Character Duplicated");
|
|
||||||
getCharacters();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".select_chat_block, .bookmark_link, .mes_bookmark", async function () {
|
$(document).on("click", ".select_chat_block, .bookmark_link, .mes_bookmark", async function () {
|
||||||
|
Reference in New Issue
Block a user