Skip to content

Commit 382fdfc

Browse files
committed
fix(cloud): remove HubSpot chat widget when dashboard unmounts
Logout navigates client-side to the sign-in page, so the widget (mounted outside React) stayed visible after a startup user logged out.
1 parent c231c29 commit 382fdfc

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎apps/dokploy/components/shared/analytics.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,11 @@ export const useHubSpotChat = (enabled: boolean) => {
9292
loadWidget,
9393
];
9494
}
95+
return () => {
96+
window.hsConversationsOnReady = window.hsConversationsOnReady?.filter(
97+
(callback) => callback !== loadWidget,
98+
);
99+
window.HubSpotConversations?.widget.remove();
100+
};
95101
}, [enabled]);
96102
};

0 commit comments

Comments
 (0)