Refactor checkpoint popups

3217087b0be9109763136708d6a5e87faa8a5a83

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +3 -8Showing whitespace changes
public/scripts/bookmarks.js+3 -8
@@ -59,11 +59,9 @@ async function getExistingChatNames() {
5959
60async function getBookmarkName() {60async function getBookmarkName() {
61 const chatNames = await getExistingChatNames();61 const chatNames = await getExistingChatNames();
62 const popupText = `<h3>Enter the checkpoint name:<h3>
63 <small>Leave empty to auto-generate.</small>`;
64 let name = await callPopup(popupText, 'input');
6562
66 if (name === false) {63 let name = await Popup.show.input('Create Checkpoint', '<span class="margin-right-10px">Enter Checkpoint Name:</span><small>(Leave empty to auto-generate)</small>');
64 if (name === null) {
67 return null;65 return null;
68 }66 }
69 else if (name === '') {67 else if (name === '') {
@@ -190,16 +188,13 @@ async function createNewBookmark(mesId) {
190 }188 }
191189
192 if (lastMes.extra.bookmark_link) {190 if (lastMes.extra.bookmark_link) {
193 const confirm = await callPopup('Checkpoint for the last message already exists. Would you like to replace it?', 'confirm');191 const confirm = await Popup.show.confirm('Replace Checkpoint', 'Checkpoint for the last message already exists.<br />Would you like to replace it?');
194
195 if (!confirm) {192 if (!confirm) {
196 return;193 return;
197 }194 }
198 }195 }
199196
200 await delay(250);
201 let name = await getBookmarkName();197 let name = await getBookmarkName();
202
203 if (!name) {198 if (!name) {
204 return;199 return;
205 }200 }