Refactor checkpoint popups
| @@ -59,11 +59,9 @@ async function getExistingChatNames() { | ||
| 59 | 59 | |
| 60 | 60 | async function getBookmarkName() { |
| 61 | 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'); | |
| 65 | 62 | |
| 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 | 65 | return null; |
| 68 | 66 | } |
| 69 | 67 | else if (name === '') { |
| @@ -190,16 +188,13 @@ async function createNewBookmark(mesId) { | ||
| 190 | 188 | } |
| 191 | 189 | |
| 192 | 190 | if (lastMes.extra.bookmark_link) { |
| 193 | 191 | const confirm = await callPopupPopup.show.confirm('Replace Checkpoint', 'Checkpoint for the last message already exists.<br />Would you like to replace it?', 'confirm'); |
| 194 | - | |
| 195 | 192 | if (!confirm) { |
| 196 | 193 | return; |
| 197 | 194 | } |
| 198 | 195 | } |
| 199 | 196 | |
| 200 | - await delay(250); | |
| 201 | 197 | let name = await getBookmarkName(); |
| 202 | - | |
| 203 | 198 | if (!name) { |
| 204 | 199 | return; |
| 205 | 200 | } |