Update old code style

fefa6a0f5ba1b40c926c1295befddd55b674232a

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +11 -11Ignore whitespace
public/scripts/bookmarks.js+11 -11
@@ -609,25 +609,25 @@ export function initBookmarks() {
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 one610 // 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 }
616616
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', '');
620620
621 if (!file_name) {621 if (!fileName) {
622 return;622 return;
623 }623 }
624624
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();
@@ -638,16 +638,16 @@ export function initBookmarks() {
638 });638 });
639639
640 $(document).on('click', '.mes_create_bookmark', async function () {640 $(document).on('click', '.mes_create_bookmark', async function () {
641 var selected_mes_id = $(this).closest('.mes').attr('mesid');641 const mesId = $(this).closest('.mes').attr('mesid');
642 if (selected_mes_id !== undefined) {642 if (mesId !== undefined) {
643 await createNewBookmark(Number(selected_mes_id));643 await createNewBookmark(Number(mesId));
644 }644 }
645 });645 });
646646
647 $(document).on('click', '.mes_create_branch', async function () {647 $(document).on('click', '.mes_create_branch', async function () {
648 var selected_mes_id = $(this).closest('.mes').attr('mesid');648 const mesId = $(this).closest('.mes').attr('mesid');
649 if (selected_mes_id !== undefined) {649 if (mesId !== undefined) {
650 await branchChat(Number(selected_mes_id));650 await branchChat(Number(mesId));
651 }651 }
652 });652 });
653653