fix(sidebar): guard virtualizer itemSize against non-finite zoom level
This commit is contained in:
@@ -216,7 +216,14 @@ export function SidebarConversationList({
|
|||||||
const t = useTranslations("Folder.sidebar")
|
const t = useTranslations("Folder.sidebar")
|
||||||
const tCommon = useTranslations("Folder.common")
|
const tCommon = useTranslations("Folder.common")
|
||||||
const { zoomLevel } = useZoomLevel()
|
const { zoomLevel } = useZoomLevel()
|
||||||
const cardHeightPx = (CARD_HEIGHT_REM * 16 * zoomLevel) / 100
|
const safeZoomLevel =
|
||||||
|
typeof zoomLevel === "number" && Number.isFinite(zoomLevel) && zoomLevel > 0
|
||||||
|
? zoomLevel
|
||||||
|
: 100
|
||||||
|
const cardHeightPx = Math.max(
|
||||||
|
1,
|
||||||
|
Math.round((CARD_HEIGHT_REM * 16 * safeZoomLevel) / 100)
|
||||||
|
)
|
||||||
const {
|
const {
|
||||||
allFolders,
|
allFolders,
|
||||||
conversations,
|
conversations,
|
||||||
|
|||||||
Reference in New Issue
Block a user