mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' of https://github.com/Tony-sama/SillyTavern into staging
This commit is contained in:
@ -164,7 +164,7 @@ function getNextIncompleteTaskRecurse(task){
|
||||
}
|
||||
|
||||
// Set a task in extensionPrompt context. Defaults to first incomplete
|
||||
function setCurrentTask(taskId = null) {
|
||||
function setCurrentTask(taskId = null, skipSave = false) {
|
||||
const context = getContext();
|
||||
|
||||
// TODO: Should probably null this rather than set empty object
|
||||
@ -202,7 +202,10 @@ function setCurrentTask(taskId = null) {
|
||||
console.info(`No current task`);
|
||||
}
|
||||
|
||||
saveState();
|
||||
// Save state if not skipping
|
||||
if (!skipSave) {
|
||||
saveState();
|
||||
}
|
||||
}
|
||||
|
||||
function getHighestTaskIdRecurse(task) {
|
||||
@ -731,7 +734,7 @@ function loadSettings() {
|
||||
$('#objective-check-frequency').val(chat_metadata['objective'].checkFrequency)
|
||||
$('#objective-hide-tasks').prop('checked', chat_metadata['objective'].hideTasks)
|
||||
$('#objective-tasks').prop('hidden', $('#objective-hide-tasks').prop('checked'))
|
||||
setCurrentTask()
|
||||
setCurrentTask(null, true)
|
||||
}
|
||||
|
||||
function addManualTaskCheckUi() {
|
||||
|
@ -818,7 +818,7 @@ function addSDGenButtons() {
|
||||
$(document).on('click touchend', function (e) {
|
||||
const target = $(e.target);
|
||||
if (target.is(dropdown)) return;
|
||||
if (target.is(button) && !dropdown.is(":visible") && $("#send_but").css('display') === 'flex') {
|
||||
if (target.is(button) && !dropdown.is(":visible") && $("#send_but").is(":visible")) {
|
||||
e.preventDefault();
|
||||
|
||||
dropdown.fadeIn(250);
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { deepClone } from "../../utils.js";
|
||||
|
||||
export { ElevenLabsTtsProvider }
|
||||
|
||||
class ElevenLabsTtsProvider {
|
||||
@ -47,18 +49,20 @@ class ElevenLabsTtsProvider {
|
||||
|
||||
loadSettings(settings) {
|
||||
// Pupulate Provider UI given input settings
|
||||
if (Object.keys(settings).length == 0) {
|
||||
if (!settings || Object.keys(settings).length == 0) {
|
||||
console.info("Using default TTS Provider settings")
|
||||
}
|
||||
|
||||
// Only accept keys defined in defaultSettings
|
||||
this.settings = this.defaultSettings
|
||||
this.settings = deepClone(this.defaultSettings);
|
||||
|
||||
for (const key in settings){
|
||||
if (key in this.settings){
|
||||
this.settings[key] = settings[key]
|
||||
} else {
|
||||
throw `Invalid setting passed to TTS Provider: ${key}`
|
||||
if (settings) {
|
||||
for (const key in settings) {
|
||||
if (key in this.settings) {
|
||||
this.settings[key] = settings[key]
|
||||
} else {
|
||||
throw `Invalid setting passed to TTS Provider: ${key}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user