From 856b835172cba0a8fbafa21ab469e5cdb2627660 Mon Sep 17 00:00:00 2001 From: Cohee Date: Tue, 4 Jul 2023 11:41:15 +0300 Subject: [PATCH 1/4] Fix migration of settings.json --- public/scripts/extensions/quick-reply/index.js | 15 ++++++++++----- public/scripts/power-user.js | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/public/scripts/extensions/quick-reply/index.js b/public/scripts/extensions/quick-reply/index.js index e22bab045..9bf3058b8 100644 --- a/public/scripts/extensions/quick-reply/index.js +++ b/public/scripts/extensions/quick-reply/index.js @@ -35,6 +35,7 @@ async function loadSettings() { } } + initializeEmptySlots(extension_settings.quickReply.numberOfSlots); generateQuickReplyElements(); for (let i = 1; i <= extension_settings.quickReply.numberOfSlots; i++) { @@ -131,6 +132,15 @@ async function onQuickReplyNumberOfSlotsInput() { extension_settings.quickReply.quickReplySlots.length = numberOfSlots; // Initialize new slots + initializeEmptySlots(numberOfSlots); + + await loadSettings(); + addQuickReplyBar(); + moduleWorker(); + saveSettingsDebounced(); +} + +function initializeEmptySlots(numberOfSlots) { for (let i = 0; i < numberOfSlots; i++) { if (!extension_settings.quickReply.quickReplySlots[i]) { extension_settings.quickReply.quickReplySlots[i] = { @@ -140,11 +150,6 @@ async function onQuickReplyNumberOfSlotsInput() { }; } } - - await loadSettings(); - addQuickReplyBar(); - moduleWorker(); - saveSettingsDebounced(); } function generateQuickReplyElements() { diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index db59dfadf..eed50c120 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -610,6 +610,10 @@ function loadPowerUserSettings(settings, data) { power_user.font_scale = Number(localStorage.getItem(storage_keys.font_scale) ?? 1); power_user.blur_strength = Number(localStorage.getItem(storage_keys.blur_strength) ?? 10); + if (power_user.chat_display === '') { + power_user.chat_display = chat_styles.DEFAULT; + } + $('#trim_spaces').prop("checked", power_user.trim_spaces); $('#continue_on_send').prop("checked", power_user.continue_on_send); $('#auto_swipe').prop("checked", power_user.auto_swipe); From dbb18ac895b53c99fa9d1bab30eeea5decff7fd8 Mon Sep 17 00:00:00 2001 From: Cohee Date: Tue, 4 Jul 2023 11:42:01 +0300 Subject: [PATCH 2/4] Bump package version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 940fc3f72..e8279bb4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sillytavern", - "version": "1.8.0", + "version": "1.8.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sillytavern", - "version": "1.8.0", + "version": "1.8.1", "license": "AGPL-3.0", "dependencies": { "@dqbd/tiktoken": "^1.0.2", diff --git a/package.json b/package.json index da4dc4925..6faf067bd 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "type": "git", "url": "https://github.com/SillyTavern/SillyTavern.git" }, - "version": "1.8.0", + "version": "1.8.1", "scripts": { "start": "node server.js", "pkg": "pkg --compress Gzip --no-bytecode --public ." From 8ad431bea6f363e8dc7fcf4a6b58789b56a86d46 Mon Sep 17 00:00:00 2001 From: Cohee Date: Tue, 4 Jul 2023 11:46:53 +0300 Subject: [PATCH 3/4] Fix waifu mode setting migration --- public/scripts/power-user.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index eed50c120..ff31ae66e 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -614,6 +614,10 @@ function loadPowerUserSettings(settings, data) { power_user.chat_display = chat_styles.DEFAULT; } + if (power_user.waifuMode === '') { + power_user.waifuMode = false; + } + $('#trim_spaces').prop("checked", power_user.trim_spaces); $('#continue_on_send').prop("checked", power_user.continue_on_send); $('#auto_swipe').prop("checked", power_user.auto_swipe); From c922f17f092da5f5cfa1dc786b6f31ecf1c4444c Mon Sep 17 00:00:00 2001 From: Cohee Date: Tue, 4 Jul 2023 11:49:46 +0300 Subject: [PATCH 4/4] Fix main_api default value --- public/script.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/script.js b/public/script.js index 7beb0378a..59a4b9f23 100644 --- a/public/script.js +++ b/public/script.js @@ -4692,16 +4692,18 @@ async function getSettings(type) { $("#amount_gen_counter").text(`${amount_gen}`); //Load which API we are using - if (settings.main_api != undefined) { - main_api = settings.main_api; - $('#main_api').val(main_api); - $("#main_api option[value=" + main_api + "]").attr( - "selected", - "true" - ); - changeMainAPI(); + if (settings.main_api == undefined) { + settings.main_api = 'kobold'; } + 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 user_avatar = settings.user_avatar;