From 90876e0094cc3351e2b7b2c887958ad658c742fd Mon Sep 17 00:00:00 2001 From: Anton SHEPILOV Date: Wed, 5 Jun 2024 17:20:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BRemoved=20routing=20state=20update?= =?UTF-8?q?=20when=20scrolling=20gallery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/views/client/viewer/drive-preview.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx b/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx index 75455480..d76b2610 100644 --- a/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx +++ b/tdrive/frontend/src/app/views/client/viewer/drive-preview.tsx @@ -78,15 +78,18 @@ export const DrivePreview: React.FC = ({ items }) => { if (loading) { animationTimeout = window.setTimeout(() => { setModalLoading(false); - }, 400); + }, 100); } }, [loading]); const switchPreview = async (item: DriveItem) => { close(); - history.push( - RouterServices.generateRouteFromState({ companyId: company, itemId: item.id, }), - ); + //TODO[ASH] fix state management for this component + //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); }; return (