| 609 | $(document).on('click', '.select_chat_block, .mes_bookmark', async function (e) { | 609 | $(document).on('click', '.select_chat_block, .mes_bookmark', async function (e) { |
| 610 | // If shift is held down, we are not following the bookmark, but creating a new one | 610 | // If shift is held down, we are not following the bookmark, but creating a new one |
| 611 | if (e.shiftKey) { | 611 | if (e.shiftKey) { |
| 612 | var selectedMesId = $(this).closest('.mes').attr('mesid'); | 612 | const selectedMesId = $(this).closest('.mes').attr('mesid'); |
| 613 | await createNewBookmark(Number(selectedMesId)); | 613 | await createNewBookmark(Number(selectedMesId)); |
| 614 | return; | 614 | return; |
| 615 | } | 615 | } |
| 616 | | 616 | |
| 617 | let file_name = $(this).hasClass('mes_bookmark') | 617 | const fileName = $(this).hasClass('mes_bookmark') |
| 618 | ? $(this).closest('.mes').attr('bookmark_link') | 618 | ? $(this).closest('.mes').attr('bookmark_link') |
| 619 | : $(this).attr('file_name').replace('.jsonl', ''); | 619 | : $(this).attr('file_name').replace('.jsonl', ''); |
| 620 | | 620 | |
| 621 | if (!file_name) { | 621 | if (!fileName) { |
| 622 | return; | 622 | return; |
| 623 | } | 623 | } |
| 624 | | 624 | |
| 625 | try { | 625 | try { |
| 626 | showLoader(); | 626 | showLoader(); |
| 627 | if (selected_group) { | 627 | if (selected_group) { |
| 628 | await openGroupChat(selected_group, file_name); | 628 | await openGroupChat(selected_group, fileName); |
| 629 | } else { | 629 | } else { |
| 630 | await openCharacterChat(file_name); | 630 | await openCharacterChat(fileName); |
| 631 | } | 631 | } |
| 632 | } finally { | 632 | } finally { |
| 633 | await hideLoader(); | 633 | await hideLoader(); |