Merge branch 'main' into dev

This commit is contained in:
Cohee
2023-07-04 12:06:25 +03:00
5 changed files with 31 additions and 16 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "sillytavern", "name": "sillytavern",
"version": "1.8.0", "version": "1.8.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "sillytavern", "name": "sillytavern",
"version": "1.8.0", "version": "1.8.1",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"dependencies": { "dependencies": {
"@dqbd/tiktoken": "^1.0.2", "@dqbd/tiktoken": "^1.0.2",

View File

@@ -49,7 +49,7 @@
"type": "git", "type": "git",
"url": "https://github.com/SillyTavern/SillyTavern.git" "url": "https://github.com/SillyTavern/SillyTavern.git"
}, },
"version": "1.8.0", "version": "1.8.1",
"scripts": { "scripts": {
"start": "node server.js", "start": "node server.js",
"pkg": "pkg --compress Gzip --no-bytecode --public ." "pkg": "pkg --compress Gzip --no-bytecode --public ."

View File

@@ -4692,16 +4692,18 @@ async function getSettings(type) {
$("#amount_gen_counter").text(`${amount_gen}`); $("#amount_gen_counter").text(`${amount_gen}`);
//Load which API we are using //Load which API we are using
if (settings.main_api != undefined) { if (settings.main_api == undefined) {
main_api = settings.main_api; settings.main_api = 'kobold';
$('#main_api').val(main_api);
$("#main_api option[value=" + main_api + "]").attr(
"selected",
"true"
);
changeMainAPI();
} }
main_api = settings.main_api;
$('#main_api').val(main_api);
$("#main_api option[value=" + main_api + "]").attr(
"selected",
"true"
);
changeMainAPI();
//Load User's Name and Avatar //Load User's Name and Avatar
user_avatar = settings.user_avatar; user_avatar = settings.user_avatar;

View File

@@ -35,6 +35,7 @@ async function loadSettings() {
} }
} }
initializeEmptySlots(extension_settings.quickReply.numberOfSlots);
generateQuickReplyElements(); generateQuickReplyElements();
for (let i = 1; i <= extension_settings.quickReply.numberOfSlots; i++) { for (let i = 1; i <= extension_settings.quickReply.numberOfSlots; i++) {
@@ -131,6 +132,15 @@ async function onQuickReplyNumberOfSlotsInput() {
extension_settings.quickReply.quickReplySlots.length = numberOfSlots; extension_settings.quickReply.quickReplySlots.length = numberOfSlots;
// Initialize new slots // Initialize new slots
initializeEmptySlots(numberOfSlots);
await loadSettings();
addQuickReplyBar();
moduleWorker();
saveSettingsDebounced();
}
function initializeEmptySlots(numberOfSlots) {
for (let i = 0; i < numberOfSlots; i++) { for (let i = 0; i < numberOfSlots; i++) {
if (!extension_settings.quickReply.quickReplySlots[i]) { if (!extension_settings.quickReply.quickReplySlots[i]) {
extension_settings.quickReply.quickReplySlots[i] = { extension_settings.quickReply.quickReplySlots[i] = {
@@ -140,11 +150,6 @@ async function onQuickReplyNumberOfSlotsInput() {
}; };
} }
} }
await loadSettings();
addQuickReplyBar();
moduleWorker();
saveSettingsDebounced();
} }
function generateQuickReplyElements() { function generateQuickReplyElements() {

View File

@@ -610,6 +610,14 @@ function loadPowerUserSettings(settings, data) {
power_user.font_scale = Number(localStorage.getItem(storage_keys.font_scale) ?? 1); power_user.font_scale = Number(localStorage.getItem(storage_keys.font_scale) ?? 1);
power_user.blur_strength = Number(localStorage.getItem(storage_keys.blur_strength) ?? 10); power_user.blur_strength = Number(localStorage.getItem(storage_keys.blur_strength) ?? 10);
if (power_user.chat_display === '') {
power_user.chat_display = chat_styles.DEFAULT;
}
if (power_user.waifuMode === '') {
power_user.waifuMode = false;
}
$('#trim_spaces').prop("checked", power_user.trim_spaces); $('#trim_spaces').prop("checked", power_user.trim_spaces);
$('#continue_on_send').prop("checked", power_user.continue_on_send); $('#continue_on_send').prop("checked", power_user.continue_on_send);
$('#auto_swipe').prop("checked", power_user.auto_swipe); $('#auto_swipe').prop("checked", power_user.auto_swipe);