fix: 🐛 only allow PDFs to be merged with existing PDF, check extension case-insensitive

This commit is contained in:
RaviAnand Mohabir 2025-04-08 15:50:35 +02:00
parent 80482af5c0
commit 3b7339e712

View File

@ -306,7 +306,7 @@ function Organizrr() {
</Group> </Group>
</AppShell.Header> </AppShell.Header>
<AppShell.Navbar p="md" bg="var(--mantine-primary-color-1)"> <AppShell.Navbar p="md" bg="var(--mantine-primary-color-0)">
<AppShell.Section> <AppShell.Section>
<Group> <Group>
<IconFiles /> <IconFiles />
@ -396,7 +396,7 @@ function Organizrr() {
/> />
</Group> </Group>
{activeFile !== null && ( {activeFile !== null && (
<Paper p="md" bg="var(--mantine-primary-color-1)"> <Paper p="md" bg="var(--mantine-primary-color-0)">
<Stack> <Stack>
<Autocomplete <Autocomplete
label="Category" label="Category"
@ -482,7 +482,8 @@ function Organizrr() {
doc.id === doc.id ===
form.values.files[activeFile]?.documents[0].id form.values.files[activeFile]?.documents[0].id
) )
?.file.name.endsWith(".pdf") && ( ?.file.name.toLowerCase()
.endsWith(".pdf") && (
<Stack <Stack
w={300} w={300}
key={form.values.files[activeFile]?.documents.length} key={form.values.files[activeFile]?.documents.length}
@ -495,7 +496,10 @@ function Organizrr() {
}))} }))}
onChange={handleDocumentSelect} onChange={handleDocumentSelect}
/> />
<Dropzone onDrop={handleDocumentDrop} /> <Dropzone
onDrop={handleDocumentDrop}
accept={["application/pdf"]}
/>
</Stack> </Stack>
)} )}
</Group> </Group>
@ -511,7 +515,7 @@ function Organizrr() {
</Stack> </Stack>
</AppShell.Main> </AppShell.Main>
<AppShell.Aside p="md" bg="var(--mantine-primary-color-1)"> <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}>Vorschau</Title>