mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
filter out nulls from map
This commit is contained in:
parent
706cfc5400
commit
c7a1e33641
@ -123,12 +123,16 @@ const FileGrid = ({
|
|||||||
h="30rem"
|
h="30rem"
|
||||||
style={{ overflowY: "auto", width: "100%" }}
|
style={{ overflowY: "auto", width: "100%" }}
|
||||||
>
|
>
|
||||||
{displayFiles.map((item, idx) => {
|
{displayFiles
|
||||||
if (!item.record?.id) {
|
.filter(item => {
|
||||||
console.error('FileGrid: File missing WorkbenchFile with proper ID:', item.file.name);
|
if (!item.record?.id) {
|
||||||
return null;
|
console.error('FileGrid: File missing WorkbenchFile with proper ID:', item.file.name);
|
||||||
}
|
return false;
|
||||||
const fileId = item.record.id;
|
}
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.map((item, idx) => {
|
||||||
|
const fileId = item.record!.id; // Safe to assert after filter
|
||||||
const originalIdx = files.findIndex(f => f.record?.id === fileId);
|
const originalIdx = files.findIndex(f => f.record?.id === fileId);
|
||||||
const supported = isFileSupported ? isFileSupported(item.file.name) : true;
|
const supported = isFileSupported ? isFileSupported(item.file.name) : true;
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user