From ac1236fe472a642a4997569677c35bbc03f90773 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Mon, 15 Apr 2024 16:29:02 +0300 Subject: [PATCH] Web: Files: fixed tile view --- packages/client/src/store/FilesStore.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/client/src/store/FilesStore.js b/packages/client/src/store/FilesStore.js index 575a367e40..469dc5964a 100644 --- a/packages/client/src/store/FilesStore.js +++ b/packages/client/src/store/FilesStore.js @@ -3961,9 +3961,12 @@ class FilesStore { const isDesktopView = isDesktop(); const tileGap = isDesktopView ? 16 : 14; const minTileWidth = 216 + tileGap; - const sectionPadding = isDesktopView ? 24 : 16; - const body = document.getElementById("section"); + const tileContainer = document.getElementById("tileContainer"); + + const sectionPadding = + body?.offsetWidth - tileContainer?.clientWidth - tileGap + 1; + const sectionWidth = body ? body.offsetWidth - sectionPadding : 0; return Math.floor(sectionWidth / minTileWidth);