fix: 🐛 handle pdf ext case-insensitive
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing

This commit is contained in:
RaviAnand Mohabir 2025-04-08 15:57:47 +02:00
parent 87f2870488
commit a29752a3e5

View File

@ -448,7 +448,8 @@ function Organizrr() {
</Group> </Group>
{form.values.documents {form.values.documents
.find((_d) => _d.id === d.id) .find((_d) => _d.id === d.id)
?.file.name.endsWith(".pdf") && ( ?.file.name.toLowerCase()
.endsWith(".pdf") && (
<ScrollArea h={400} w="100%"> <ScrollArea h={400} w="100%">
<Document <Document
file={ file={
@ -518,26 +519,27 @@ function Organizrr() {
<AppShell.Aside p="md" bg="var(--mantine-primary-color-0)"> <AppShell.Aside p="md" bg="var(--mantine-primary-color-0)">
<Stack align="center"> <Stack align="center">
<Group style={{ alignSelf: "start" }}> <Group style={{ alignSelf: "start" }}>
<IconEye /> <Title order={3}>Vorschau</Title> <IconEye /> <Title order={3}>Preview</Title>
</Group> </Group>
{activeDocument && activeDocument.file.name.endsWith(".pdf") && ( {activeDocument &&
<> activeDocument.file.name.toLowerCase().endsWith(".pdf") && (
<Text>{activeDocument.file.name}</Text> <>
<ScrollArea w="100%"> <Text>{activeDocument.file.name}</Text>
<Document <ScrollArea w="100%">
file={activeDocument.file} <Document
onLoadSuccess={onDocumentLoadSuccess} file={activeDocument.file}
> onLoadSuccess={onDocumentLoadSuccess}
<Page pageNumber={pageNumber} scale={0.8} /> >
</Document> <Page pageNumber={pageNumber} scale={0.8} />
</ScrollArea> </Document>
<Pagination </ScrollArea>
value={pageNumber} <Pagination
onChange={setPageNumber} value={pageNumber}
total={numPages ?? 0} onChange={setPageNumber}
/> total={numPages ?? 0}
</> />
)} </>
)}
</Stack> </Stack>
</AppShell.Aside> </AppShell.Aside>