From 20dcb55adbea834b1695401e0c83debd9931d15d Mon Sep 17 00:00:00 2001 From: "adamlui@protonmail.com" Date: Mon, 23 Sep 2024 18:42:59 +0000 Subject: [PATCH] =?UTF-8?q?Improved=20`settings.load()`=20to=20accept=20ar?= =?UTF-8?q?rays=20for=20flexibility=20=E2=86=9E=20[auto-sync=20from=20`ada?= =?UTF-8?q?mlui/chatgpt-apps`]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- greasemonkey/bravegpt.user.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/greasemonkey/bravegpt.user.js b/greasemonkey/bravegpt.user.js index 8020cc73..01c25f1a 100644 --- a/greasemonkey/bravegpt.user.js +++ b/greasemonkey/bravegpt.user.js @@ -148,7 +148,7 @@ // @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!) // @author KudoAI // @namespace https://kudoai.com -// @version 2024.9.22.7 +// @version 2024.9.23 // @license MIT // @icon https://media.bravegpt.com/images/icons/bravegpt/icon48.png?0a9e287 // @icon64 https://media.bravegpt.com/images/icons/bravegpt/icon64.png?0a9e287 @@ -245,7 +245,11 @@ // Init DEBUG mode const config = {}, settings = { - load(...keys) { keys.forEach(key => config[key] = GM_getValue(app.configKeyPrefix + '_' + key, false)) }, + load(...keys) { + if (Array.isArray(keys[0])) keys = keys[0] // use 1st array arg, else all comma-separated ones + console.log(keys) + keys.forEach(key => config[key] = GM_getValue(app.configKeyPrefix + '_' + key, false)) + }, save(key, value) { GM_setValue(app.configKeyPrefix + '_' + key, value) ; config[key] = value } } ; settings.load('debugMode')