Skip to content

Commit

Permalink
[core] Simplify server detection (#40471)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Jan 14, 2024
1 parent 0f73482 commit e91b96e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/data/joy/getting-started/templates/messages/utils.ts
Original file line number Diff line number Diff line change
@@ -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');
}
Expand All @@ -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');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
}
Expand Down

0 comments on commit e91b96e

Please sign in to comment.