diff --git a/docs/data/joy/getting-started/templates/messages/utils.ts b/docs/data/joy/getting-started/templates/messages/utils.ts index ac814adefca930..9cdb2b244b1485 100644 --- a/docs/data/joy/getting-started/templates/messages/utils.ts +++ b/docs/data/joy/getting-started/templates/messages/utils.ts @@ -1,12 +1,12 @@ export function openSidebar() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.body.style.overflow = 'hidden'; document.documentElement.style.setProperty('--SideNavigation-slideIn', '1'); } } export function closeSidebar() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.documentElement.style.removeProperty('--SideNavigation-slideIn'); document.body.style.removeProperty('overflow'); } @@ -26,14 +26,14 @@ export function toggleSidebar() { } export function openMessagesPane() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.body.style.overflow = 'hidden'; document.documentElement.style.setProperty('--MessagesPane-slideIn', '1'); } } export function closeMessagesPane() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.documentElement.style.removeProperty('--MessagesPane-slideIn'); document.body.style.removeProperty('overflow'); } diff --git a/docs/data/joy/getting-started/templates/order-dashboard/utils.ts b/docs/data/joy/getting-started/templates/order-dashboard/utils.ts index 58fdec53e099e7..64c8e860d23d8e 100644 --- a/docs/data/joy/getting-started/templates/order-dashboard/utils.ts +++ b/docs/data/joy/getting-started/templates/order-dashboard/utils.ts @@ -1,12 +1,12 @@ export function openSidebar() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.body.style.overflow = 'hidden'; document.documentElement.style.setProperty('--SideNavigation-slideIn', '1'); } } export function closeSidebar() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.documentElement.style.removeProperty('--SideNavigation-slideIn'); document.body.style.removeProperty('overflow'); } diff --git a/docs/data/joy/getting-started/templates/profile-dashboard/utils.ts b/docs/data/joy/getting-started/templates/profile-dashboard/utils.ts index 58fdec53e099e7..64c8e860d23d8e 100644 --- a/docs/data/joy/getting-started/templates/profile-dashboard/utils.ts +++ b/docs/data/joy/getting-started/templates/profile-dashboard/utils.ts @@ -1,12 +1,12 @@ export function openSidebar() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.body.style.overflow = 'hidden'; document.documentElement.style.setProperty('--SideNavigation-slideIn', '1'); } } export function closeSidebar() { - if (typeof document !== 'undefined') { + if (typeof window !== 'undefined') { document.documentElement.style.removeProperty('--SideNavigation-slideIn'); document.body.style.removeProperty('overflow'); }