Skip to content

Commit

Permalink
fix: added an early return on non-existent items (#2571)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurMousatov committed Jul 27, 2023
1 parent b508ac3 commit 2744f7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/views/files/Listing.vue
Expand Up @@ -606,10 +606,12 @@ export default {
},
colunmsResize() {
// Update the columns size based on the window width.
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
if (!items) return;
let columns = Math.floor(
document.querySelector("main").offsetWidth / this.columnWidth
);
let items = css(["#listing.mosaic .item", ".mosaic#listing .item"]);
if (columns === 0) columns = 1;
items.style.width = `calc(${100 / columns}% - 1em)`;
},
Expand Down

0 comments on commit 2744f7d

Please sign in to comment.