🐛Removed routing state update when scrolling gallery

This commit is contained in:
Anton SHEPILOV
2024-06-05 17:20:48 +02:00
committed by Anton Shepilov
parent df775f0b57
commit 90876e0094
@@ -78,15 +78,18 @@ export const DrivePreview: React.FC<DrivePreviewProps> = ({ items }) => {
if (loading) { if (loading) {
animationTimeout = window.setTimeout(() => { animationTimeout = window.setTimeout(() => {
setModalLoading(false); setModalLoading(false);
}, 400); }, 100);
} }
}, [loading]); }, [loading]);
const switchPreview = async (item: DriveItem) => { const switchPreview = async (item: DriveItem) => {
close(); close();
history.push( //TODO[ASH] fix state management for this component
RouterServices.generateRouteFromState({ companyId: company, itemId: item.id, }), //right now changing the routing leads to a lot of components rerender
); //and galery become unusable
// history.push(
// RouterServices.generateRouteFromState({ companyId: company, itemId: item.id, }),
// );
open(item); open(item);
}; };
return ( return (