Schließe den Leser, wenn eine entfernte Datei die Navigation ausblendet.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
79241831fd
commit
562c0848b1
5 files changed
+104
-35
No files matched your search
@@ -282,9 +282,10 @@ export function ReadingPane({ binding, context, backLabel, onClose, onReload, ca
|
||||
const task = { cancel: null };
|
||||
pdf.getPage(page).then((pdfPage) => {
|
||||
if (!alive) return;
|
||||
const viewport = pdfPage.getViewport({ scale });
|
||||
const canvas = canvasRef.current;
|
||||
const context2d = canvas.getContext("2d");
|
||||
const context2d = canvas?.getContext("2d");
|
||||
if (!canvas || !context2d) return;
|
||||
const viewport = pdfPage.getViewport({ scale });
|
||||
canvas.width = viewport.width;
|
||||
canvas.height = viewport.height;
|
||||
const render = pdfPage.render({ canvasContext: context2d, viewport });
|
||||
@@ -440,16 +441,28 @@ export function ReadingPane({ binding, context, backLabel, onClose, onReload, ca
|
||||
const search = new URLSearchParams();
|
||||
search.set("context_kind", context.kind);
|
||||
search.set("context_id", context.id);
|
||||
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
|
||||
onClose();
|
||||
onReload();
|
||||
setError("");
|
||||
try {
|
||||
await api(`/api/v1/bindings/${binding.id}?${search}`, { method: "DELETE" });
|
||||
markDirty(false);
|
||||
onClose();
|
||||
onReload();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
async function destroy() {
|
||||
if (!window.confirm("Überall löschen? Alle Einbindungen verschwinden. Eine Paperless-Quelle bleibt unangetastet.")) return;
|
||||
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
|
||||
onClose();
|
||||
onReload();
|
||||
setError("");
|
||||
try {
|
||||
await api(`/api/v1/elements/${element.id}/delete`, { method: "POST", body: { expected_version: element.version } });
|
||||
markDirty(false);
|
||||
onClose();
|
||||
onReload();
|
||||
} catch (err) {
|
||||
setError(err.message);
|
||||
}
|
||||
}
|
||||
|
||||
if (!binding) {
|
||||
|
||||
Reference in new issue
Block a user