mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 17:07:07 +01:00
Remove unnecessary double popup for replace
This commit is contained in:
parent
27e0905a1b
commit
748005b903
@ -57,10 +57,10 @@ async function getExistingChatNames() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getBookmarkName({ forceName = null } = {}) {
|
async function getBookmarkName({ isReplace = false, forceName = null } = {}) {
|
||||||
const chatNames = await getExistingChatNames();
|
const chatNames = await getExistingChatNames();
|
||||||
|
|
||||||
const body = await renderTemplateAsync('createCheckpoint');
|
const body = await renderTemplateAsync('createCheckpoint', { isReplace: isReplace });
|
||||||
let name = forceName || await Popup.show.input('Create Checkpoint', body);
|
let name = forceName || await Popup.show.input('Create Checkpoint', body);
|
||||||
if (name === null) {
|
if (name === null) {
|
||||||
return null;
|
return null;
|
||||||
@ -195,14 +195,9 @@ export async function createNewBookmark(mesId, { forceName = null } = {}) {
|
|||||||
lastMes.extra = {};
|
lastMes.extra = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMes.extra.bookmark_link && !forceName) {
|
const isReplace = lastMes.extra.bookmark_link;
|
||||||
const confirm = await Popup.show.confirm('Replace Checkpoint', 'Checkpoint for the last message already exists.<br />Would you like to replace it?');
|
|
||||||
if (!confirm) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let name = await getBookmarkName({ forceName: forceName });
|
let name = await getBookmarkName({ isReplace: isReplace, forceName: forceName });
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1 +1,8 @@
|
|||||||
<span class="margin-right-10px">Enter Checkpoint Name:</span><small>(Leave empty to auto-generate)</small>
|
<div>
|
||||||
|
<span class="margin-right-10px">Enter Checkpoint Name:</span><small>(Leave empty to auto-generate)</small>
|
||||||
|
</div>
|
||||||
|
{{#if isReplace}}
|
||||||
|
<div class="m-t-1">
|
||||||
|
<small>The currently existing checkpoint will be unlinked and replaced with the new checkpoint, but can still be found in the Chat Management.</small>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
Loading…
Reference in New Issue
Block a user