mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
@@ -8746,11 +8746,18 @@ function formatSwipeCounter(current, total) {
|
|||||||
return `${current}\u200b/\u200b${total}`;
|
return `${current}\u200b/\u200b${total}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function swipe_left() { // when we swipe left..but no generation.
|
/**
|
||||||
|
* Handles the swipe to the left event.
|
||||||
|
* @param {JQuery.Event} _event Event.
|
||||||
|
* @param {object} params Additional parameters.
|
||||||
|
* @param {string} [params.source] The source of the swipe event.
|
||||||
|
* @param {boolean} [params.repeated] Is the swipe event repeated.
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
function swipe_left(_event, { source, repeated } = {}) { // when we swipe left..but no generation.
|
||||||
if (chat.length - 1 === Number(this_edit_mes_id)) {
|
if (chat.length - 1 === Number(this_edit_mes_id)) {
|
||||||
closeMessageEditor();
|
closeMessageEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isStreamingEnabled() && streamingProcessor) {
|
if (isStreamingEnabled() && streamingProcessor) {
|
||||||
streamingProcessor.onStopStreaming();
|
streamingProcessor.onStopStreaming();
|
||||||
}
|
}
|
||||||
@@ -8758,6 +8765,11 @@ function swipe_left() { // when we swipe left..but no generation.
|
|||||||
// Make sure ad-hoc changes to extras are saved before swiping away
|
// Make sure ad-hoc changes to extras are saved before swiping away
|
||||||
syncMesToSwipe();
|
syncMesToSwipe();
|
||||||
|
|
||||||
|
if (source === 'keyboard' && repeated && chat[chat.length - 1].swipe_id === 0) {
|
||||||
|
// If the user is holding down the key and we're at the first swipe, don't do anything
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const swipe_duration = 120;
|
const swipe_duration = 120;
|
||||||
const swipe_range = '700px';
|
const swipe_range = '700px';
|
||||||
chat[chat.length - 1]['swipe_id']--;
|
chat[chat.length - 1]['swipe_id']--;
|
||||||
|
@@ -1143,7 +1143,7 @@ export function initRossMods() {
|
|||||||
$('#shadow_select_chat_popup').css('display') === 'none' &&
|
$('#shadow_select_chat_popup').css('display') === 'none' &&
|
||||||
!isInputElementInFocus()
|
!isInputElementInFocus()
|
||||||
) {
|
) {
|
||||||
$('.swipe_left:last').click();
|
$('.swipe_left:last').trigger('click', { source: 'keyboard', repeated: event.repeat });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user