fix: image pasted into a note right after another save is lost on reload (#32175)

Pasting an image into a note a moment after another change to that note was saved could lose the image. The note page got the result of the earlier save back after the paste and took over its older, empty list of attached files, so the image was saved without its file. After a reload it showed as a grey placeholder and was missing from the PDF export. The note page now keeps its own attached files while it still has a change waiting to be saved.

Fixes #32123
This commit is contained in:
Classic298 2026-10-10 17:58:05 +02:00 • committed by GitHub
parent d12bf062b5
commit 93838060b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -885,7 +885,8 @@ ${content}
note.access_grants = _note.access_grants;
}
if (_note.data && 'files' in _note.data) {
// A pending local save holds newer files than an echo of an earlier save.
if (_note.data && 'files' in _note.data && !debounceTimeout) {
files = _note.data.files ?? [];
note.data.files = files.length > 0 ? files : null;
}