Refactor checkpoint popups
| @@ -59,11 +59,9 @@ async function getExistingChatNames() { | |||
| 59 | 59 | ||
| 60 | async function getBookmarkName() { | 60 | async 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'); | ||
| 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 | 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 | } |
| 191 | 189 | ||
| 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 | } |
| 199 | 196 | ||
| 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 | } |