diff --git a/app/layout.tsx b/app/layout.tsx index 015acf2db..f40a72abb 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -14,22 +14,6 @@ export default function RootLayout({ }) { return ( -
- - - {children} ) diff --git a/app/w/components/control-bar/control-bar.tsx b/app/w/components/control-bar/control-bar.tsx index 3ada77bae..287865b8d 100644 --- a/app/w/components/control-bar/control-bar.tsx +++ b/app/w/components/control-bar/control-bar.tsx @@ -31,6 +31,12 @@ export function ControlBar() { const { workflows, removeWorkflow, activeWorkflowId } = useWorkflowRegistry() const router = useRouter() + // Use client-side only rendering for the timestamp + const [mounted, setMounted] = useState(false) + useEffect(() => { + setMounted(true) + }, []) + // Get notifications for current workflow const workflowNotifications = activeWorkflowId ? getWorkflowNotifications(activeWorkflowId) @@ -64,10 +70,14 @@ export function ControlBar() {- Saved{' '} - {formatDistanceToNow(history.present.timestamp, { addSuffix: true })} -
+ {mounted && ( // Only render the timestamp after client-side hydration ++ Saved{' '} + {formatDistanceToNow(history.present.timestamp, { + addSuffix: true, + })} +
+ )} {/* Middle Section - Reserved for future use */} diff --git a/lib/utils.ts b/lib/utils.ts index 52c9d71b8..1a860ee3c 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -3,11 +3,4 @@ import { twMerge } from "tailwind-merge" export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) -} - -export const getTimestamp = () => { - if (typeof window === 'undefined') { - return Date.now() - } - return window.INITIAL_TIMESTAMP || Date.now() -} +} \ No newline at end of file diff --git a/stores/notifications/notifications-store.ts b/stores/notifications/notifications-store.ts index 4c6d5cfa3..dabe679d6 100644 --- a/stores/notifications/notifications-store.ts +++ b/stores/notifications/notifications-store.ts @@ -1,7 +1,6 @@ import { create } from 'zustand' import { devtools } from 'zustand/middleware' import { NotificationType, Notification, NotificationStore } from './types' -import { getTimestamp } from '@/lib/utils' const STORAGE_KEY = 'workflow-notifications' @@ -24,14 +23,18 @@ export const useNotificationStore = create