fix(mobile/note_icon): wrong icons displayed

This commit is contained in:
Elian Doran 2026-02-02 13:45:13 +02:00
parent 90bb162a88
commit aa4942a0da
No known key found for this signature in database

View File

@ -185,7 +185,8 @@ function NoteIconList({ note, onHide, columnCount }: {
rowHeight={ICON_SIZE}
cellComponent={IconItemCell}
cellProps={{
filteredIcons
filteredIcons,
columnCount
}}
/>
) : (
@ -196,10 +197,11 @@ function NoteIconList({ note, onHide, columnCount }: {
);
}
function IconItemCell({ rowIndex, columnIndex, style, filteredIcons }: CellComponentProps<{
function IconItemCell({ rowIndex, columnIndex, style, filteredIcons, columnCount }: CellComponentProps<{
filteredIcons: IconWithName[];
columnCount: number;
}>) {
const iconIndex = rowIndex * 12 + columnIndex;
const iconIndex = rowIndex * columnCount + columnIndex;
const iconData = filteredIcons[iconIndex] as IconWithName | undefined;
if (!iconData) return <></> as React.ReactElement;