Remove cross-tab localStorage synchronization
This commit is contained in:
parent
8859f39820
commit
d9f285c072
1 changed files with 0 additions and 15 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue