Add inheritSwipeDataFromPriorMessage function to populate swipe slots with tracker data from prior messages in cases where tracker auto-update is disabled. This maintains the paradigm of every swipe having saved tracker data, which can then be regenerated by the user manually if they so choose.
This commit is contained in:
@@ -24,7 +24,7 @@ import {
|
||||
getSeparateGenerationId,
|
||||
incrementSeparateGenerationId
|
||||
} from '../../core/state.js';
|
||||
import { saveChatData, loadChatData, autoSwitchPresetForEntity, getSwipeData, commitTrackerDataFromPriorMessage, mirrorToSwipeInfo } from '../../core/persistence.js';
|
||||
import { saveChatData, loadChatData, autoSwitchPresetForEntity, getSwipeData, commitTrackerDataFromPriorMessage, inheritSwipeDataFromPriorMessage, mirrorToSwipeInfo } from '../../core/persistence.js';
|
||||
import { i18n } from '../../core/i18n.js';
|
||||
|
||||
// Generation & Parsing
|
||||
@@ -302,6 +302,13 @@ export async function onMessageReceived(data) {
|
||||
// Just render the music player
|
||||
renderMusicPlayer($musicPlayerContainer[0]);
|
||||
}
|
||||
|
||||
// When auto-update is disabled,no tracker API call will run for this message.
|
||||
// Inherit the prior assistant message's tracker data into this swipe slot so that
|
||||
// commitTrackerDataFromPriorMessage can find a valid state next turn instead of nulling everything
|
||||
if (!extensionSettings.autoUpdate || !isAwaitingNewMessage) {
|
||||
inheritSwipeDataFromPriorMessage(lastMessage, chat.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger auto-update if enabled (for both separate and external modes)
|
||||
|
||||
Reference in New Issue
Block a user