Skip to content

Commit 7005316

Browse files
committed
Condensed sync.mode()
1 parent 71310b5 commit 7005316

File tree

2 files changed

+8
-12
lines changed
  • chatgpt-widescreen

2 files changed

+8
-12
lines changed

chatgpt-widescreen/chromium/extension/lib/sync.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ window.sync = {
4444
: chatgpt.isFullScreen() )
4545
settings.save(mode, state) ; buttons.update.svg(mode)
4646
if (!config.extensionDisabled && !config[`${env.site}Disabled`]) { // tweak UI
47-
if (env.site == 'chatgpt') {
48-
if (config.widerChatbox) styles.update({ key: 'chatbar' })
49-
setTimeout(() => chatbar.tweak(), // update inner width
50-
mode == 'fullWindow' && config.widescreen && config.widerChatbox ?
51-
111 : 0) // delay if toggled to/from active WCB to avoid wrong width
52-
} else if (env.site == 'poe' && config.widerChatbox) styles.update({ key: 'chatbar' }) // sync Poe WCB
47+
if (env.site == 'chatgpt') setTimeout(() => chatbar.tweak(), // update inner width
48+
mode == 'fullWindow' && config.widescreen && config.widerChatbox ?
49+
111 : 0) // delay if toggled to/from active WCB to avoid wrong width
50+
if (config.widerChatbox) styles.update({ key: 'chatbar' }) // sync WCB
5351
notify(`${browserAPI.getMsg('mode_' + mode)} ${
5452
browserAPI.getMsg(`state_${ state ? 'on' : 'off' }`).toUpperCase()}`)
5553
}

chatgpt-widescreen/firefox/extension/lib/sync.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ window.sync = {
4444
: chatgpt.isFullScreen() )
4545
settings.save(mode, state) ; buttons.update.svg(mode)
4646
if (!config.extensionDisabled && !config[`${env.site}Disabled`]) { // tweak UI
47-
if (env.site == 'chatgpt') {
48-
if (config.widerChatbox) styles.update({ key: 'chatbar' })
49-
setTimeout(() => chatbar.tweak(), // update inner width
50-
mode == 'fullWindow' && config.widescreen && config.widerChatbox ?
51-
111 : 0) // delay if toggled to/from active WCB to avoid wrong width
52-
} else if (env.site == 'poe' && config.widerChatbox) styles.update({ key: 'chatbar' }) // sync Poe WCB
47+
if (env.site == 'chatgpt') setTimeout(() => chatbar.tweak(), // update inner width
48+
mode == 'fullWindow' && config.widescreen && config.widerChatbox ?
49+
111 : 0) // delay if toggled to/from active WCB to avoid wrong width
50+
if (config.widerChatbox) styles.update({ key: 'chatbar' }) // sync WCB
5351
notify(`${browserAPI.getMsg('mode_' + mode)} ${
5452
browserAPI.getMsg(`state_${ state ? 'on' : 'off' }`).toUpperCase()}`)
5553
}

0 commit comments

Comments
 (0)