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:
parent
47c421dbfa
commit
64409359b3
2 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue