1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 21:06:42 +07:00

fixed node rendering

This commit is contained in:
Fedor Katurov 2019-11-07 16:51:03 +07:00
parent 47c421dbfa
commit 64409359b3
2 changed files with 4 additions and 4 deletions

View file

@ -77,11 +77,11 @@ const NodeImageSlideBlock: FC<IProps> = ({ node, is_loading, updateLayout }) =>
const { width } = wrap.current.getBoundingClientRect();
if (is_loading) return setHeight((width * 9) / 16);
const selected = Math.abs(-offset / width);
if (is_loading) {
return setHeight((width * 9) / 16);
}
if (!heights[Math.round(selected)]) return setHeight((width * 9) / 16);
const prev = Math.max(heights[Math.floor(selected)] || 320, 320);
const next = Math.max(heights[Math.ceil(selected)] || 320, 320);