Skip to content

Commit cb2ee51

Browse files
committed
Move response ready notification to trigger only after generation completes and remove sessionStorage check
1 parent c461753 commit cb2ee51

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎apps/browser/src/content-scripts/send-prompt-content-script/utils/add-apply-response-button.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,14 @@ export function observe_for_responses(params: {
8181
action: 'finished-responding'
8282
})
8383
has_sent_finished_responding = true
84+
show_response_ready_notification({ chatbot_name: params.chatbot_name })
8485
}
8586

8687
const all_footers = document.querySelectorAll(params.footer_selector)
8788
if (all_footers.length == 0) {
8889
return
8990
}
9091

91-
show_response_ready_notification({ chatbot_name: params.chatbot_name })
92-
9392
all_footers.forEach((footer) => {
9493
params.add_buttons(footer)
9594
})

‎apps/browser/src/content-scripts/send-prompt-content-script/utils/show-response-ready-notification.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
export const show_response_ready_notification = async (params: {
22
chatbot_name: string
33
}) => {
4-
const NOTIFICATION_SHOWN_KEY = 'cwc_notification_shown'
5-
6-
if (sessionStorage.getItem(NOTIFICATION_SHOWN_KEY)) return
7-
sessionStorage.setItem(NOTIFICATION_SHOWN_KEY, 'true')
8-
94
if (!('Notification' in window) || document.hasFocus()) {
105
return
116
}

0 commit comments

Comments
 (0)