Do not emit storage event when changing grid snapshot
To prevent unnecessary re-renders. The current grid state was stored in the session storage which then triggered an immediate re-render because the just saved snapshot got restored again
This commit is contained in:
@@ -165,7 +165,7 @@ const VerticalGrid = forwardRef(
|
||||
return;
|
||||
}
|
||||
|
||||
AppStorage.session.setItem(snapshotSessionKey, gridState);
|
||||
AppStorage.session.setItem(snapshotSessionKey, gridState, false);
|
||||
}, 250);
|
||||
};
|
||||
useEffect(() => clearTimeout(persistGridStateTimeout.current), [location.key, persistGridStateTimeout.current]);
|
||||
|
||||
@@ -269,7 +269,7 @@ export function SourceMangas() {
|
||||
);
|
||||
|
||||
const scrollToTop = useCallback(() => {
|
||||
AppStorage.session.setItem(getGridSnapshotKey(location), undefined);
|
||||
AppStorage.session.setItem(getGridSnapshotKey(location), undefined, false);
|
||||
window.scrollTo(0, 0);
|
||||
}, [locationKey]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user