From 42fa37d347738a6f6cb11fa6d4fc6fc7a6aa9a0a Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Tue, 21 Jan 2025 14:47:56 +0000 Subject: [PATCH] Send beacon request on disconnect as well This is so we can dismiss any notifications that arrived for a bubble while we were viewing that bubble. Otherwise, they'll stick around until we leave the page and come back. --- app/javascript/controllers/beacon_controller.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/javascript/controllers/beacon_controller.js b/app/javascript/controllers/beacon_controller.js index 07182bb36..794565f78 100644 --- a/app/javascript/controllers/beacon_controller.js +++ b/app/javascript/controllers/beacon_controller.js @@ -7,4 +7,8 @@ export default class extends Controller { connect() { post(this.urlValue, { responseKind: "turbo-stream" }) } + + disconnect() { + post(this.urlValue, { responseKind: "turbo-stream" }) + } }