Remove cross-tab localStorage synchronization

This commit is contained in:
Qian 2025-10-10 10:16:36 +08:00
parent 8859f39820
commit d9f285c072

View file

@ -34,21 +34,6 @@ export const LocalStorageProvider: React.FC<{ children: React.ReactNode }> = ({
syncWithLocalStorage();
}, []);
// Listen for localStorage changes from other tabs
useEffect(() => {
const handleStorageChange = (event: StorageEvent) => {
if (event.key === "fontSize") {
syncWithLocalStorage();
}
};
window.addEventListener("storage", handleStorageChange);
return () => {
window.removeEventListener("storage", handleStorageChange);
};
}, []);
// Listen for current tab changes using CustomEvent
useEffect(() => {
const handleLocalStorageChange = (event: CustomEvent) => {