diff --git a/app/layout.tsx b/app/layout.tsx index 8a90f75d47..1a38b15008 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -9,11 +9,18 @@ export const metadata: Metadata = { export default function RootLayout({ children, -}: Readonly<{ +}: { children: React.ReactNode -}>) { +}) { return ( +
+ + {children} ) diff --git a/lib/utils.ts b/lib/utils.ts index bd0c391ddd..52c9d71b84 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -1,6 +1,13 @@ -import { clsx, type ClassValue } from "clsx" +import { type ClassValue, clsx } from "clsx" 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() +} diff --git a/stores/notifications/notifications-store.ts b/stores/notifications/notifications-store.ts index 48455e0f17..ead27dbf8c 100644 --- a/stores/notifications/notifications-store.ts +++ b/stores/notifications/notifications-store.ts @@ -1,6 +1,7 @@ import { create } from 'zustand' import { devtools } from 'zustand/middleware' import { NotificationType, Notification, NotificationStore } from './types' +import { getTimestamp } from '@/lib/utils' export const useNotificationStore = create