Skip to content

Commit

Permalink
Improved settings.load() to accept arrays for flexibility ↞ [auto-s…
Browse files Browse the repository at this point in the history
…ync from `adamlui/chatgpt-apps`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Sep 23, 2024
1 parent a624717 commit 20dcb55
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions greasemonkey/bravegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit 20dcb55

Please sign in to comment.