Skip to content

Commit cd3d040

Browse files
committed
chore(dev-stack): dedupe FileInput; bump cryptify + pkg submodules
- `FileInput.svelte`: drop duplicate adds in the dropzone. A file already in the list (matched by name + size + lastModified) is silently removed from the dropzone instead of getting a second entry — same behaviour as Gmail's attach UI. - `cryptify` → v0.1.27-9-g63066a1 (picks up the staging preview endpoint that the email-preview modal depends on, plus the `build.rs` Cargo.lock-driven `PG_CORE_VERSION` change). - `postguard` (pg-pkg) → pg-ffi-v0.1.2-9-gcc47b60 (accepts Yivi condiscon in IrmaAuthRequest, which pg-js 2.0 emits for the optional name disjunction). - `docker-compose.yml`: mount `cryptify/build.rs` and `cryptify/Cargo.lock` into the dev container; the bumped cryptify needs both at compile time to set the `X-PostGuard` mail header.
1 parent 5b811b2 commit cd3d040

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ services:
1818
- ./cryptify/conf/config.dev.toml:/app/config.toml:ro
1919
- ./cryptify/src:/app/src
2020
- ./cryptify/templates:/app/templates
21+
# build.rs feeds `PG_CORE_VERSION` (used by the X-PostGuard
22+
# mail header) from Cargo.lock at compile time. Both files
23+
# need to be visible inside the container, or cargo bails
24+
# on `env!("PG_CORE_VERSION")`.
25+
- ./cryptify/build.rs:/app/build.rs:ro
26+
- ./cryptify/Cargo.lock:/app/Cargo.lock:ro
2127
- cryptify-target:/app/target
2228
environment:
2329
- RUST_LOG=info

src/lib/components/filesharing/inputs/FileInput.svelte

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@
8787
})
8888
8989
myDropzone.on('addedfile', (file) => {
90+
const isDuplicate = files.some(
91+
(f) =>
92+
f.name === file.name &&
93+
f.size === file.size &&
94+
f.lastModified === file.lastModified
95+
)
96+
if (isDuplicate) {
97+
myDropzone!.removeFile(file)
98+
return
99+
}
100+
90101
files = files.concat([file])
91102
percentages = percentages.concat([0])
92103
done = done.concat([false])

0 commit comments

Comments
 (0)