diff --git a/public/index.html b/public/index.html index 8f91fccdb..be50b7029 100644 --- a/public/index.html +++ b/public/index.html @@ -1308,6 +1308,10 @@
-

Creators's Tags

+

Creator's Tags

@@ -3458,4 +3460,4 @@ - + \ No newline at end of file diff --git a/public/script.js b/public/script.js index 9981a0167..21d542518 100644 --- a/public/script.js +++ b/public/script.js @@ -180,6 +180,7 @@ export { select_rm_info, setCharacterId, setCharacterName, + replaceCurrentChat, setOnlineStatus, checkOnlineStatus, setEditedMessageId, @@ -5544,21 +5545,20 @@ function openCharacterWorldPopup() { const fileName = getCharaFilename(chid); const tempExtraBooks = selectedWorlds.map((index) => world_names[index]).filter((e) => e !== undefined); - const existingCharLore = charLore.find((e) => e.name === fileName); - if (existingCharLore) { - if (tempExtraBooks.length === 0) { - charLore.splice(existingCharLore, 1); - } else { - existingCharLore.extraBooks = tempExtraBooks; - } - } else { + const existingCharIndex = charLore.findIndex((e) => e.name === fileName); + if (existingCharIndex === -1) { const newCharLoreEntry = { name: fileName, extraBooks: tempExtraBooks } charLore.push(newCharLoreEntry); + } else if (tempExtraBooks.length === 0) { + charLore.splice(existingCharIndex, 1); + } else { + charLore[existingCharIndex].extraBooks = tempExtraBooks; } + Object.assign(world_info, { charLore: charLore }); saveSettingsDebounced(); } @@ -7704,7 +7704,7 @@ $(document).ready(function () { eventSource.emit(event_types.GENERATION_STOPPED); }); - $('.drawer-toggle').click(function () { + $('.drawer-toggle').on('click', function () { var icon = $(this).find('.drawer-icon'); var drawer = $(this).parent().find('.drawer-content'); if (drawer.hasClass('resizing')) { return } @@ -7741,7 +7741,7 @@ $(document).ready(function () { } - } else if (drawerWasOpenAlready) { //to close + } else if (drawerWasOpenAlready) { //to close manually icon.toggleClass('closedIcon openIcon'); if (pinnedDrawerClicked) { @@ -7787,7 +7787,9 @@ $(document).ready(function () { if (jQuery.find('.openDrawer').length !== 0) { if (targetParentHasOpenDrawer === 0) { //console.log($('.openDrawer').not('.pinnedOpen').length); - $('.openDrawer').not('.pinnedOpen').slideToggle(200, "swing"); + $('.openDrawer').not('.pinnedOpen').addClass('resizing').slideToggle(200, "swing", function () { + $(this).closest('.drawer-content').removeClass('resizing') + }); $('.openIcon').toggleClass('closedIcon openIcon'); $('.openDrawer').not('.pinnedOpen').toggleClass('closedDrawer openDrawer'); @@ -7981,8 +7983,8 @@ $(document).ready(function () { const html = `

Enter the URL of the content to import

Supported sources: