From 897a3439361e400649dd2676f0b2eda1f9c90d71 Mon Sep 17 00:00:00 2001 From: codytseng Date: Tue, 21 Oct 2025 11:17:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=92=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/providers/UserPreferencesProvider.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/providers/UserPreferencesProvider.tsx b/src/providers/UserPreferencesProvider.tsx index 61214bd..35ad530 100644 --- a/src/providers/UserPreferencesProvider.tsx +++ b/src/providers/UserPreferencesProvider.tsx @@ -1,6 +1,6 @@ import storage from '@/services/local-storage.service' import { TNotificationStyle } from '@/types' -import { createContext, useContext, useState } from 'react' +import { createContext, useContext, useEffect, useState } from 'react' import { useScreenSize } from './ScreenSizeProvider' type TUserPreferencesContext = { @@ -38,6 +38,14 @@ export function UserPreferencesProvider({ children }: { children: React.ReactNod storage.getEnableSingleColumnLayout() ) + useEffect(() => { + if (!isSmallScreen && enableSingleColumnLayout) { + document.documentElement.style.setProperty('overflow-y', 'scroll') + } else { + document.documentElement.style.removeProperty('overflow-y') + } + }, [enableSingleColumnLayout, isSmallScreen]) + const updateNotificationListStyle = (style: TNotificationStyle) => { setNotificationListStyle(style) storage.setNotificationListStyle(style)