Skip to content

Commit c231c29

Browse files
committed
fix(cloud): load HubSpot chat widget for startup plan users
The HubSpot script is loaded app-wide with loadImmediately: false, but useHubSpotChat was never called, so widget.load() never ran. The old HubSpotWidget shared the hs-script-loader id and was deduped by next/script.
1 parent a0e0574 commit c231c29

2 files changed

Lines changed: 2 additions & 21 deletions

File tree

‎apps/dokploy/components/layouts/dashboard-layout.tsx‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useEffect } from "react";
44
import { api } from "@/utils/api";
55
import { useWhitelabeling } from "@/utils/hooks/use-whitelabeling";
66
import { ImpersonationBar } from "../dashboard/impersonation/impersonation-bar";
7-
import { HubSpotWidget } from "../shared/HubSpotWidget";
7+
import { useHubSpotChat } from "../shared/analytics";
88
import Page from "./side";
99

1010
interface Props {
@@ -26,6 +26,7 @@ export const DashboardLayout = ({ children, metaName }: Props) => {
2626
});
2727

2828
const isChatEnabled = isCloud === true && currentPlan === "startup";
29+
useHubSpotChat(isChatEnabled);
2930

3031
const { data: onboardingStatus } = api.project.onboardingStatus.useQuery();
3132
const shouldRedirectToOnboarding =
@@ -52,12 +53,6 @@ export const DashboardLayout = ({ children, metaName }: Props) => {
5253
</Head>
5354
)}
5455
<Page>{children}</Page>
55-
{isChatEnabled && (
56-
<>
57-
<HubSpotWidget />
58-
</>
59-
)}
60-
6156
{haveRootAccess === true && <ImpersonationBar />}
6257
</>
6358
);

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

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)