Refactor checkpoint popups

3217087b0be9109763136708d6a5e87faa8a5a83

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +3 -8Ignore whitespace
public/scripts/bookmarks.js+3 -8
@@ -59,11 +59,9 @@ async function getExistingChatNames() {
5959
6060async function getBookmarkName() {
6161 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) {
6765 return null;
6866 }
6967 else if (name === '') {
@@ -190,16 +188,13 @@ async function createNewBookmark(mesId) {
190188 }
191189
192190 if (lastMes.extra.bookmark_link) {
193191 const confirm = await callPopupPopup.show.confirm('Replace Checkpoint', 'Checkpoint for the last message already exists.<br />Would you like to replace it?', 'confirm');
194-
195192 if (!confirm) {
196193 return;
197194 }
198195 }
199196
200- await delay(250);
201197 let name = await getBookmarkName();
202-
203198 if (!name) {
204199 return;
205200 }