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