Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@
"appearance": "Appearance",
"whatsapp": "WhatsApp",
"templates": "Templates",
"quick-replies": "Quick replies",
"fields": "Fields & tags",
"deals": "Deals & currency",
"members": "Team members",
Expand Down
13 changes: 12 additions & 1 deletion src/app/(dashboard)/automations/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { useMemo } from "react"
import { Suspense, useMemo } from "react"
import { useSearchParams } from "next/navigation"

import {
Expand All @@ -11,7 +11,18 @@ import {
import { AUTOMATION_TEMPLATES, type TemplateSlug } from "@/lib/automations/templates"
import type { AutomationStepType, AutomationTriggerType } from "@/types"

// `useSearchParams` requires a Suspense boundary or the production build
// bails to CSR and errors out. Thin wrapper supplies it; the inner
// component reads the `?template=` query string.
export default function NewAutomationPage() {
return (
<Suspense fallback={null}>
<NewAutomationPageInner />
</Suspense>
)
}

function NewAutomationPageInner() {
const params = useSearchParams()
const template = params.get("template") as TemplateSlug | null

Expand Down
13 changes: 12 additions & 1 deletion src/app/(dashboard)/inbox/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { useState, useCallback, useEffect, useRef } from "react";
import { Suspense, useState, useCallback, useEffect, useRef } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { useTranslations } from "next-intl";
import { createClient } from "@/lib/supabase/client";
Expand All @@ -13,7 +13,7 @@
import { ConversationList } from "@/components/inbox/conversation-list";
import { MessageThread } from "@/components/inbox/message-thread";
import { ContactSidebar } from "@/components/inbox/contact-sidebar";
import { toast } from "sonner";

Check warning on line 16 in src/app/(dashboard)/inbox/page.tsx

View workflow job for this annotation

GitHub Actions / Lint, typecheck, test, build

'toast' is defined but never used
import { WifiOff } from "lucide-react";
import { cn } from "@/lib/utils";

Expand All @@ -21,7 +21,18 @@
// across reloads and sessions (device-scoped, like the theme prefs).
const CONTACT_PANEL_STORAGE_KEY = "wacrm:inbox:contact-panel-open";

// `useSearchParams` (the `?c=<id>` deep link below) requires a Suspense
// boundary or the production build bails to CSR and errors out. Thin
// wrapper supplies it; the inner component holds all the inbox state.
export default function InboxPage() {
return (
<Suspense fallback={null}>
<InboxPageInner />
</Suspense>
);
}

function InboxPageInner() {
const t = useTranslations("Inbox.page");
const router = useRouter();
const searchParams = useSearchParams();
Expand Down
18 changes: 17 additions & 1 deletion src/app/(dashboard)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useMemo, type ReactNode } from 'react';
import { Suspense, useMemo, type ReactNode } from 'react';
import { useRouter, useSearchParams } from 'next/navigation';
import { useTranslations } from 'next-intl';

Expand All @@ -23,7 +23,23 @@ import {
type SettingsSection,
} from '@/components/settings/settings-sections';

// `useSearchParams` opts this page out of static prerendering unless it
// sits under a Suspense boundary. Without one, the production build hits
// the "missing Suspense with CSR bailout" error and the whole page bails
// to client-side rendering — shipping a settings screen whose rail never
// wires up its click handlers. You land on the section the URL carried
// (the account-menu Settings link points at `?tab=whatsapp`) and can't
// navigate away. Mirror the login/signup split: a thin wrapper supplies
// the boundary; the inner component reads the query string.
export default function SettingsPage() {
return (
<Suspense fallback={null}>
<SettingsPageInner />
</Suspense>
);
}

function SettingsPageInner() {
const router = useRouter();
const searchParams = useSearchParams();
const { defaultCurrency } = useAuth();
Expand Down
Loading