mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
Default Ena Planner to disabled for new users
This commit is contained in:
@@ -47,9 +47,12 @@ function getHtmlPath() {
|
|||||||
* Default settings
|
* Default settings
|
||||||
* --------------------------
|
* --------------------------
|
||||||
*/
|
*/
|
||||||
function getDefaultSettings() {
|
function getDefaultSettings(options = {}) {
|
||||||
|
const {
|
||||||
|
enabled = false,
|
||||||
|
} = options;
|
||||||
return {
|
return {
|
||||||
enabled: true,
|
enabled,
|
||||||
skipIfPlotPresent: true,
|
skipIfPlotPresent: true,
|
||||||
|
|
||||||
// Chat history: tags to strip from AI responses (besides <think>)
|
// Chat history: tags to strip from AI responses (besides <think>)
|
||||||
@@ -121,8 +124,11 @@ let sendKeydownHandler = null;
|
|||||||
* Helpers
|
* Helpers
|
||||||
* --------------------------
|
* --------------------------
|
||||||
*/
|
*/
|
||||||
function ensureSettings() {
|
function ensureSettings(options = {}) {
|
||||||
const d = getDefaultSettings();
|
const {
|
||||||
|
defaultEnabled = false,
|
||||||
|
} = options;
|
||||||
|
const d = getDefaultSettings({ enabled: defaultEnabled });
|
||||||
const s = config || structuredClone(d);
|
const s = config || structuredClone(d);
|
||||||
|
|
||||||
function deepMerge(target, src) {
|
function deepMerge(target, src) {
|
||||||
@@ -168,8 +174,9 @@ function normalizeResponseKeepTags(tags) {
|
|||||||
|
|
||||||
async function loadConfig() {
|
async function loadConfig() {
|
||||||
const loaded = await EnaPlannerStorage.get('config', null);
|
const loaded = await EnaPlannerStorage.get('config', null);
|
||||||
config = (loaded && typeof loaded === 'object') ? loaded : getDefaultSettings();
|
const hasSavedConfig = !!(loaded && typeof loaded === 'object');
|
||||||
ensureSettings();
|
config = hasSavedConfig ? loaded : getDefaultSettings({ enabled: false });
|
||||||
|
ensureSettings({ defaultEnabled: hasSavedConfig ? true : false });
|
||||||
state.logs = Array.isArray(await EnaPlannerStorage.get('logs', [])) ? await EnaPlannerStorage.get('logs', []) : [];
|
state.logs = Array.isArray(await EnaPlannerStorage.get('logs', [])) ? await EnaPlannerStorage.get('logs', []) : [];
|
||||||
|
|
||||||
if (extension_settings?.[EXT_NAME]) {
|
if (extension_settings?.[EXT_NAME]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user