mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add try-catch for bookmarks
This commit is contained in:
@ -60,6 +60,7 @@ function getMainChatName(currentChat) {
|
||||
}
|
||||
|
||||
function showBookmarksButtons() {
|
||||
try {
|
||||
// In groups or without an active chat
|
||||
if (selected_group || !characters[this_chid].chat) {
|
||||
$("#option_back_to_main").hide();
|
||||
@ -76,6 +77,11 @@ function showBookmarksButtons() {
|
||||
$("#option_back_to_main").show();
|
||||
$("#option_new_bookmark").show();
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$("#option_back_to_main").hide();
|
||||
$("#option_new_bookmark").hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
@ -93,7 +99,7 @@ $(document).ready(function () {
|
||||
saveChat();
|
||||
});
|
||||
|
||||
$('#option_back_to_main').on('click', async function() {
|
||||
$('#option_back_to_main').on('click', async function () {
|
||||
const mainChatName = getMainChatName(characters[this_chid].chat);
|
||||
const allChats = await getExistingChatNames();
|
||||
|
||||
|
Reference in New Issue
Block a user