Update old code style

This commit is contained in:
Cohee
2024-09-13 20:31:50 +03:00
parent dc7bc30f4b
commit fefa6a0f5b

View File

@@ -609,25 +609,25 @@ export function initBookmarks() {
$(document).on('click', '.select_chat_block, .mes_bookmark', async function (e) { $(document).on('click', '.select_chat_block, .mes_bookmark', async function (e) {
// If shift is held down, we are not following the bookmark, but creating a new one // If shift is held down, we are not following the bookmark, but creating a new one
if (e.shiftKey) { if (e.shiftKey) {
var selectedMesId = $(this).closest('.mes').attr('mesid'); const selectedMesId = $(this).closest('.mes').attr('mesid');
await createNewBookmark(Number(selectedMesId)); await createNewBookmark(Number(selectedMesId));
return; return;
} }
let file_name = $(this).hasClass('mes_bookmark') const fileName = $(this).hasClass('mes_bookmark')
? $(this).closest('.mes').attr('bookmark_link') ? $(this).closest('.mes').attr('bookmark_link')
: $(this).attr('file_name').replace('.jsonl', ''); : $(this).attr('file_name').replace('.jsonl', '');
if (!file_name) { if (!fileName) {
return; return;
} }
try { try {
showLoader(); showLoader();
if (selected_group) { if (selected_group) {
await openGroupChat(selected_group, file_name); await openGroupChat(selected_group, fileName);
} else { } else {
await openCharacterChat(file_name); await openCharacterChat(fileName);
} }
} finally { } finally {
await hideLoader(); await hideLoader();
@@ -638,16 +638,16 @@ export function initBookmarks() {
}); });
$(document).on('click', '.mes_create_bookmark', async function () { $(document).on('click', '.mes_create_bookmark', async function () {
var selected_mes_id = $(this).closest('.mes').attr('mesid'); const mesId = $(this).closest('.mes').attr('mesid');
if (selected_mes_id !== undefined) { if (mesId !== undefined) {
await createNewBookmark(Number(selected_mes_id)); await createNewBookmark(Number(mesId));
} }
}); });
$(document).on('click', '.mes_create_branch', async function () { $(document).on('click', '.mes_create_branch', async function () {
var selected_mes_id = $(this).closest('.mes').attr('mesid'); const mesId = $(this).closest('.mes').attr('mesid');
if (selected_mes_id !== undefined) { if (mesId !== undefined) {
await branchChat(Number(selected_mes_id)); await branchChat(Number(mesId));
} }
}); });