Skip to content

Commit f716909

Browse files
committed
Remove polling loop for reasoning effort slider selection
1 parent 61db57a commit f716909

1 file changed

Lines changed: 3 additions & 25 deletions

File tree

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

‎apps/browser/src/content-scripts/send-prompt-content-script/chatbots/chatgpt.ts‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,9 @@ export const chatgpt: Chatbot = {
8181

8282
await new Promise((resolve) => setTimeout(resolve, 500))
8383

84-
const slider = await new Promise<HTMLElement | null>((resolve) => {
85-
let attempts = 0
86-
87-
const check_for_slider = () => {
88-
const element = document.querySelector(
89-
'[data-model-reasoning-effort-slider] [role="slider"]'
90-
) as HTMLElement
91-
92-
if (element) {
93-
resolve(element)
94-
return
95-
}
96-
97-
attempts++
98-
99-
if (attempts >= 20) {
100-
resolve(null)
101-
return
102-
}
103-
104-
setTimeout(check_for_slider, 50)
105-
}
106-
107-
check_for_slider()
108-
})
84+
const slider = document.querySelector(
85+
'[data-model-reasoning-effort-slider] [role="slider"]'
86+
) as HTMLElement
10987

11088
if (!slider) {
11189
report_initialization_error({

0 commit comments

Comments
 (0)