From 2389cd91b414effc3196652d567ee2aa66d76253 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Sun, 12 Feb 2023 13:47:36 +0200 Subject: [PATCH 1/2] Fix settings resetting. Hide secondary key unless selective --- public/index.html | 45 ++++++++++++++++++++++++--------------------- server.js | 2 +- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/public/index.html b/public/index.html index e5d7c6c46..3975f4669 100644 --- a/public/index.html +++ b/public/index.html @@ -2333,26 +2333,6 @@ koboldai_setting_names = {}; koboldai_setting_names = arr_holder; - // world info settings - koboldai_world_names = data.koboldai_world_names?.length ? data.koboldai_world_names : []; - - if(settings.kobold_world != undefined) { - if (koboldai_world_names.includes(settings.kobold_world)) { - kobold_world = settings.kobold_world; - kobold_world_synced = false; - kobold_sync_failed = false; - } - } - - koboldai_world_names.forEach((item, i) => { - $('#world_info').append(``); - // preselect world if saved - if (item == kobold_world){ - $('#world_info').val(i).change(); - } - }); - // end world info settings - preset_settings = settings.preset_settings; temp = settings.temp; @@ -2440,6 +2420,26 @@ api_server = settings.api_server; $('#api_url_text').val(api_server); + + // world info settings + koboldai_world_names = data.koboldai_world_names?.length ? data.koboldai_world_names : []; + + if(settings.kobold_world != undefined) { + if (koboldai_world_names.includes(settings.kobold_world)) { + kobold_world = settings.kobold_world; + kobold_world_synced = false; + kobold_sync_failed = false; + } + } + + koboldai_world_names.forEach((item, i) => { + $('#world_info').append(``); + // preselect world if saved + if (item == kobold_world) { + $('#world_info').val(i).change(); + } + }); + // end world info settings } if(!is_checked_colab) isColab(); @@ -3086,6 +3086,9 @@ const value = $(this).prop('checked'); kobold_world_data.entries[uid].selective = value; saveWorldInfo(); + + const keysecondary = $(this).closest('.world_entry').find('.keysecondary'); + value ? keysecondary.show() : keysecondary.hide(); }); selectiveInput.prop('checked', entry.selective).trigger('input'); selectiveInput.siblings('.checkbox_fancy').click(function() { @@ -3378,7 +3381,7 @@ -
+