Skip to content

Commit a920ead

Browse files
committed
add guards as per CodeRabbit
1 parent b7b6db4 commit a920ead

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/playground/app/dashboard/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default function DemoPage(): React.JSX.Element {
3333
}, []);
3434

3535
const handleIdentifyUser = () => {
36+
if (!isInitialized || !userId) return;
3637
formbricks.setUserId(userId);
3738
formbricks.setAttribute("userType", "Demo-customer");
3839
formbricks.setAttribute("plan", "enterprise");
@@ -44,10 +45,12 @@ export default function DemoPage(): React.JSX.Element {
4445

4546
const handleCloseDashboard = () => {
4647
setIsDashboardOpen(false);
48+
if (!isInitialized) return;
4749
formbricks.track("dashboard-viewed");
4850
};
4951

5052
const handleUpgradeAction = () => {
53+
if (!isInitialized) return;
5154
formbricks.track("upgrade-clicked");
5255
};
5356

0 commit comments

Comments
 (0)