Skip to content

Commit

Permalink
Renamed state to menuState for readability ↞ [auto-sync from `ada…
Browse files Browse the repository at this point in the history
…mlui/chatgpt-apps/chatgpt-auto-refresh`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Jun 19, 2024
1 parent f5bba9a commit b973de8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions chatgpt/chatgpt-auto-refresh/chatgpt-auto-refresh.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
// @description:zu *NGOKUPHEPHA* susa ukusetha kabusha ingxoxo yemizuzu eyi-10 + amaphutha enethiwekhi ahlala njalo + Ukuhlolwa kwe-Cloudflare ku-ChatGPT.
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.6.17
// @version 2024.6.18
// @license MIT
// @match *://chatgpt.com/*
// @match *://chat.openai.com/*
Expand Down Expand Up @@ -313,7 +313,7 @@

// Init MENU objs
const menuIDs = [] // to store registered cmds for removal while preserving order
const state = {
const menuState = {
symbol: ['❌', '✔️'], word: ['OFF', 'ON'],
separator: getUserscriptManager() == 'Tampermonkey' ? ' — ' : ': '
}
Expand Down Expand Up @@ -401,38 +401,38 @@
function registerMenu() {

// Add command to toggle auto-refresh
const arLabel = state.symbol[+!config.arDisabled] + ' '
const arLabel = menuState.symbol[+!config.arDisabled] + ' '
+ ( msgs.menuLabel_autoRefresh || 'Auto-Refresh' ) + ' ↻ '
+ state.separator + state.word[+!config.arDisabled]
+ menuState.separator + menuState.word[+!config.arDisabled]
menuIDs.push(GM_registerMenuCommand(arLabel, () => {
document.getElementById('arSwitchSpan').click()
}))

// Add command to toggle visibility of toggle
const tvLabel = state.symbol[+!config.toggleHidden] + ' '
const tvLabel = menuState.symbol[+!config.toggleHidden] + ' '
+ ( msgs.menuLabel_toggleVis || 'Toggle Visibility' )
+ state.separator + state.word[+!config.toggleHidden]
+ menuState.separator + menuState.word[+!config.toggleHidden]
menuIDs.push(GM_registerMenuCommand(tvLabel, () => {
saveSetting('toggleHidden', !config.toggleHidden)
navToggleDiv.style.display = config.toggleHidden ? 'none' : 'flex' // toggle visibility
if (!config.notifDisabled) notify((
msgs.menuLabel_toggleVis || 'Toggle Visibility' ) + ': '+ state.word[+!config.toggleHidden])
msgs.menuLabel_toggleVis || 'Toggle Visibility' ) + ': '+ menuState.word[+!config.toggleHidden])
refreshMenu()
}))

// Add command to show notifications when switching modes
const mnLabel = state.symbol[+!config.notifDisabled] + ' '
const mnLabel = menuState.symbol[+!config.notifDisabled] + ' '
+ ( msgs.menuLabel_modeNotifs || 'Mode Notifications' )
+ state.separator + state.word[+!config.notifDisabled]
+ menuState.separator + menuState.word[+!config.notifDisabled]
menuIDs.push(GM_registerMenuCommand(mnLabel, () => {
saveSetting('notifDisabled', !config.notifDisabled)
notify(( msgs.menuLabel_modeNotifs || 'Mode Notifications' ) + ': ' + state.word[+!config.notifDisabled])
notify(( msgs.menuLabel_modeNotifs || 'Mode Notifications' ) + ': ' + menuState.word[+!config.notifDisabled])
refreshMenu()
}))

// Add command to change refresh interval
const riLabel = '⌚ ' + ( msgs.menuLabel_refreshInt || 'Refresh Interval' ) + ' '
+ state.separator + config.refreshInterval + 's'
+ menuState.separator + config.refreshInterval + 's'
menuIDs.push(GM_registerMenuCommand(riLabel, () => {
while (true) {
const refreshInterval = prompt(
Expand Down

0 comments on commit b973de8

Please sign in to comment.