Fix code formatting
| @@ -787,7 +787,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) { | ||
| 787 | 787 | sendSystemMessage(system_message_types.EMPTY, '', { isSmallSys: true }); |
| 788 | 788 | return Promise.resolve(); |
| 789 | 789 | } |
| 790 | - | |
| 790 | + | |
| 791 | 791 | try { |
| 792 | 792 | throwIfAborted(); |
| 793 | 793 | hideSwipeButtons(); |
| @@ -857,13 +857,13 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) { | ||
| 857 | 857 | const bias = getBiasStrings(userInput, type); |
| 858 | 858 | await sendMessageAsUser(userInput, bias.messageBias); |
| 859 | 859 | await saveChatConditional(); |
| 860 | 860 | $('#send_textarea').val('')[0].dispatchEvent(new Event('input', { bubbles: true })); |
| 861 | 861 | } |
| 862 | 862 | groupChatQueueOrder = new Map(); |
| 863 | 863 | |
| 864 | 864 | if (power_user.show_group_chat_queue) { |
| 865 | 865 | for (let i = 0; i < activatedMembers.length; ++i) { |
| 866 | 866 | groupChatQueueOrder.set(characters[activatedMembers[i]].avatar, i + 1); |
| 867 | 867 | } |
| 868 | 868 | } |
| 869 | 869 | // now the real generation begins: cycle through every activated character |
| @@ -873,7 +873,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) { | ||
| 873 | 873 | const generateType = type == 'swipe' || type == 'impersonate' || type == 'quiet' || type == 'continue' ? type : 'group_chat'; |
| 874 | 874 | setCharacterId(chId); |
| 875 | 875 | setCharacterName(characters[chId].name); |
| 876 | 876 | if (power_user.show_group_chat_queue) { |
| 877 | 877 | printGroupMembers(); |
| 878 | 878 | } |
| 879 | 879 | await eventSource.emit(event_types.GROUP_MEMBER_DRAFTED, chId); |
| @@ -896,9 +896,9 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) { | ||
| 896 | 896 | messageChunk = textResult?.messageChunk; |
| 897 | 897 | } |
| 898 | 898 | } |
| 899 | 899 | if (power_user.show_group_chat_queue) { |
| 900 | 900 | groupChatQueueOrder.delete(characters[chId].avatar); |
| 901 | 901 | groupChatQueueOrder.forEach((value, key, map) => map.set(key, value - 1)); |
| 902 | 902 | } |
| 903 | 903 | } |
| 904 | 904 | } finally { |
| @@ -907,7 +907,7 @@ async function generateGroupWrapper(by_auto_mode, type = null, params = {}) { | ||
| 907 | 907 | is_group_generating = false; |
| 908 | 908 | setSendButtonState(false); |
| 909 | 909 | setCharacterId(undefined); |
| 910 | 910 | if (power_user.show_group_chat_queue) { |
| 911 | 911 | groupChatQueueOrder = new Map(); |
| 912 | 912 | printGroupMembers(); |
| 913 | 913 | } |
| @@ -1328,12 +1328,12 @@ function getGroupCharacterBlock(character) { | ||
| 1328 | 1328 | const isFav = character.fav || character.fav == 'true'; |
| 1329 | 1329 | template.data('id', character.avatar); |
| 1330 | 1330 | template.find('.avatar img').attr({ 'src': avatar, 'title': character.avatar }); |
| 1331 | 1331 | template.find('.ch_name').text(character.name + (character.queueOrder > 0 ? ' (#' + character.queueOrder + ')' : '')); template.attr('chid', characters.indexOf(character)); |
| 1332 | 1332 | template.find('.ch_fav').val(isFav); |
| 1333 | 1333 | template.toggleClass('is_fav', isFav); |
| 1334 | - | |
| 1334 | + | |
| 1335 | 1335 | let queuePosition = groupChatQueueOrder.get(character.avatar); |
| 1336 | 1336 | if (queuePosition) { |
| 1337 | 1337 | template.find('.queue_position').text(queuePosition); |
| 1338 | 1338 | template.toggleClass('is_queued', queuePosition > 1); |
| 1339 | 1339 | template.toggleClass('is_active', queuePosition === 1); |