Skip to content

Commit 853d04d

Browse files
committed
Refactor the set_options function to correctly handle the absence of the thinking toggle element
1 parent f1452cb commit 853d04d

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

  • packages/browser/src/content-scripts/send-prompt-content-script/chatbots

‎packages/browser/src/content-scripts/send-prompt-content-script/chatbots/ai-studio.ts‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,18 @@ export const ai_studio: Chatbot = {
107107
function_name: 'set_options',
108108
log_message: 'Thinking toggle not found'
109109
})
110-
return
111-
}
112-
113-
if (
114-
options.includes('disable-thinking') &&
115-
supported_options?.['disable-thinking']
116-
) {
117-
if (thinking_toggle.getAttribute('aria-checked') == 'true') {
118-
thinking_toggle.click()
119-
}
120110
} else {
121-
if (thinking_toggle?.getAttribute('aria-checked') == 'false') {
122-
thinking_toggle.click()
111+
if (
112+
options.includes('disable-thinking') &&
113+
supported_options?.['disable-thinking']
114+
) {
115+
if (thinking_toggle.getAttribute('aria-checked') == 'true') {
116+
thinking_toggle.click()
117+
}
118+
} else {
119+
if (thinking_toggle?.getAttribute('aria-checked') == 'false') {
120+
thinking_toggle.click()
121+
}
123122
}
124123
}
125124

0 commit comments

Comments
 (0)