Skip to content

Commit 9f94ab5

Browse files
committed
Gate processing next chat on inject_apply_response_button flag
- 'ask' should not reuse 'edit' tab ├── apps │ ├── browser │ │ └── src │ │ ├── background │ │ │ ├── message-handler.ts │ │ │ └── websocket.ts │ │ └── content-scripts │ │ └── send-prompt-content-script │ │ └── send-prompt-content-script.ts │ └── editor │ └── src │ ├── services │ │ ├── websocket-manager.ts │ │ └── websocket-server-process.ts │ └── views │ └── prompt │ └── backend │ └── message-handlers │ ├── handle-autofill.ts │ └── handle-preview-web-configuration.ts └── packages └── shared └── src └── types ├── prompt-types.ts └── websocket-message.ts
1 parent 8951874 commit 9f94ab5

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎apps/browser/src/background/message-handler.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ const process_next_chat = async () => {
7979
? {
8080
chatbot: current_chat_message.chatbot,
8181
model: current_chat_message.model
82-
? CHATBOTS[current_chat_message.chatbot as keyof typeof CHATBOTS]?.models?.[
83-
current_chat_message.model
84-
]?.label ?? current_chat_message.model
82+
? (CHATBOTS[current_chat_message.chatbot as keyof typeof CHATBOTS]
83+
?.models?.[current_chat_message.model]?.label ??
84+
current_chat_message.model)
8585
: undefined,
8686
reasoning_effort: current_chat_message.reasoning_effort
8787
}
@@ -114,7 +114,8 @@ const process_next_chat = async () => {
114114
last_opened_tab_client_id === current_chat_message.client_id &&
115115
last_opened_tab_chatbot === current_chat_message.chatbot &&
116116
is_finished_responding &&
117-
last_opened_tab_injected_apply_button
117+
last_opened_tab_injected_apply_button &&
118+
current_chat_message.inject_apply_response_button
118119
) {
119120
try {
120121
const tab = await browser.tabs.get(last_opened_tab_id)
@@ -190,7 +191,9 @@ const handle_initialize_chat_message = async (
190191
}
191192

192193
if (!is_allowed) {
193-
console.warn(`Blocked initialize-chat with disallowed URL: ${message.url}`)
194+
console.warn(
195+
`Blocked initialize-chat with disallowed URL: ${message.url}`
196+
)
194197
return
195198
}
196199
} catch {

0 commit comments

Comments
 (0)