Ditto for right swipe
| @@ -8752,7 +8752,6 @@ function formatSwipeCounter(current, total) { | ||
| 8752 | 8752 | * @param {object} params Additional parameters. |
| 8753 | 8753 | * @param {string} [params.source] The source of the swipe event. |
| 8754 | 8754 | * @param {boolean} [params.repeated] Is the swipe event repeated. |
| 8755 | - * @returns | |
| 8756 | 8755 | */ |
| 8757 | 8756 | function swipe_left(_event, { source, repeated } = {}) { // when we swipe left..but no generation. |
| 8758 | 8757 | if (chat.length - 1 === Number(this_edit_mes_id)) { |
| @@ -8765,8 +8764,8 @@ function swipe_left(_event, { source, repeated } = {}) { // when we swipe l | ||
| 8765 | 8764 | // Make sure ad-hoc changes to extras are saved before swiping away |
| 8766 | 8765 | syncMesToSwipe(); |
| 8767 | 8766 | |
| 8768 | - if (source === 'keyboard' && repeated && chat[chat.length - 1].swipe_id === 0) { | |
| 8769 | 8767 | // If the user is holding down the key and we're at the first swipe, don't do anything |
| 8768 | + if (source === 'keyboard' && repeated && chat[chat.length - 1].swipe_id === 0) { | |
| 8770 | 8769 | return; |
| 8771 | 8770 | } |
| 8772 | 8771 | |
| @@ -8895,8 +8894,14 @@ function swipe_left(_event, { source, repeated } = {}) { // when we swipe l | ||
| 8895 | 8894 | } |
| 8896 | 8895 | } |
| 8897 | 8896 | |
| 8898 | -// when we click swipe right button | |
| 8897 | +/** | |
| 8899 | -const swipe_right = () => { | |
| 8898 | + * Handles the swipe to the right event. | |
| 8899 | + * @param {JQuery.Event} _event Event. | |
| 8900 | + * @param {object} params Additional parameters. | |
| 8901 | + * @param {string} [params.source] The source of the swipe event. | |
| 8902 | + * @param {boolean} [params.repeated] Is the swipe event repeated. | |
| 8903 | + */ | |
| 8904 | +function swipe_right(_event, { source, repeated } = {}) { | |
| 8900 | 8905 | if (chat.length - 1 === Number(this_edit_mes_id)) { |
| 8901 | 8906 | closeMessageEditor(); |
| 8902 | 8907 | } |
| @@ -8929,6 +8934,10 @@ const swipe_right = () => { | ||
| 8929 | 8934 | if (chat.length === 1 && chat[0]['swipe_id'] !== undefined && chat[0]['swipe_id'] === chat[0]['swipes'].length - 1) { // if swipe_right is called on the last alternate greeting, loop back around |
| 8930 | 8935 | chat[0]['swipe_id'] = 0; |
| 8931 | 8936 | } else { |
| 8937 | + // If the user is holding down the key and we're at the last swipe, don't do anything | |
| 8938 | + if (source === 'keyboard' && repeated && chat[chat.length - 1].swipe_id === chat[chat.length - 1].swipes.length - 1) { | |
| 8939 | + return; | |
| 8940 | + } | |
| 8932 | 8941 | chat[chat.length - 1]['swipe_id']++; // make new slot in array |
| 8933 | 8942 | } |
| 8934 | 8943 | if (chat[chat.length - 1].extra) { |
| @@ -9077,7 +9086,7 @@ const swipe_right = () => { | ||
| 9077 | 9086 | }, |
| 9078 | 9087 | }); |
| 9079 | 9088 | } |
| 9080 | 9089 | }; |
| 9081 | 9090 | |
| 9082 | 9091 | export const CONNECT_API_MAP = { |
| 9083 | 9092 | // Default APIs not contined inside text gen / chat gen |
| @@ -1156,7 +1156,7 @@ export function initRossMods() { | ||
| 1156 | 1156 | $('#shadow_select_chat_popup').css('display') === 'none' && |
| 1157 | 1157 | !isInputElementInFocus() |
| 1158 | 1158 | ) { |
| 1159 | 1159 | $('.swipe_right:last').clicktrigger('click', { source: 'keyboard', repeated: event.repeat }); |
| 1160 | 1160 | return; |
| 1161 | 1161 | } |
| 1162 | 1162 | } |