Skip to content

Commit

Permalink
Split config/settings inits into 2 lines for readability ↞ [auto-…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Nov 23, 2024
1 parent 5748575 commit 7710bd0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions greasemonkey/duckduckgpt.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-DuckDuckGo (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.11.22.5
// @version 2024.11.22.6
// @license MIT
// @icon https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302
// @icon64 https://media.ddgpt.com/images/icons/duckduckgpt/icon64.png?af89302
Expand Down Expand Up @@ -371,7 +371,8 @@
}

// Init DEBUG mode
const config = {}, settings = {
const config = {}
const settings = {
load(...keys) {
if (Array.isArray(keys[0])) keys = keys[0] // use 1st array arg, else all comma-separated ones
keys.forEach(key => config[key] = GM_getValue(app.configKeyPrefix + '_' + key, false))
Expand Down Expand Up @@ -482,8 +483,8 @@
byScriptManager: /Tampermonkey|ScriptCat/.test(env.scriptManager.name) }
log.debug(`Success! streamingSupported = ${log.prettifyObj(streamingSupported)}`)

// Init CONFIG
log.debug('Initializing config...')
// Init SETTINGS
log.debug('Initializing settings...')
Object.assign(config, { userLanguage: chatgpt.getUserLanguage(), minFontSize: 11, maxFontSize: 24, lineHeightRatio: 1.28 })
config.userLocale = env.browser.language.includes('-') ? env.browser.language.split('-')[1].toLowerCase() : ''
settings.load('anchored', 'autoGet', 'autoFocusChatbarDisabled', 'autoScroll', 'bgAnimationsDisabled', 'expanded',
Expand Down

0 comments on commit 7710bd0

Please sign in to comment.