From 69c28dadc24553735897365f38384dd8f86974e8 Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Thu, 12 Dec 2024 16:24:42 -0500 Subject: [PATCH 1/5] Redaction layers are appearing on other documents Fixes #968 --- src/langs/json/en.json | 1 + .../components/viewer/RedactionLayer.svelte | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/langs/json/en.json b/src/langs/json/en.json index 939923a1b..530a6a009 100644 --- a/src/langs/json/en.json +++ b/src/langs/json/en.json @@ -458,6 +458,7 @@ "undo": "Undo", "cancel": "Discard", "cancelWarning": "You will lose unsaved redactions. Are you sure you want to cancel?", + "leaveWarning": "You have unsaved redactions. Are you sure you want to leave?", "success": "Redactions saved", "error": "Error" }, diff --git a/src/lib/components/viewer/RedactionLayer.svelte b/src/lib/components/viewer/RedactionLayer.svelte index 786d99579..ca9749109 100644 --- a/src/lib/components/viewer/RedactionLayer.svelte +++ b/src/lib/components/viewer/RedactionLayer.svelte @@ -1,6 +1,8 @@
Date: Thu, 12 Dec 2024 16:35:11 -0500 Subject: [PATCH 2/5] Small optims --- src/lib/components/forms/ConfirmRedaction.svelte | 1 + src/lib/components/viewer/RedactionLayer.svelte | 14 +------------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/lib/components/forms/ConfirmRedaction.svelte b/src/lib/components/forms/ConfirmRedaction.svelte index 7f84750c3..8a2961c9a 100644 --- a/src/lib/components/forms/ConfirmRedaction.svelte +++ b/src/lib/components/forms/ConfirmRedaction.svelte @@ -44,6 +44,7 @@ This almost certainly lives in a modal. if (result.type === "success") { // need to invalidate before navigating await invalidate(`document:${document.id}`); + $redactions = []; $pending = result.data.redactions; goto("?mode=document"); dispatch("close"); diff --git a/src/lib/components/viewer/RedactionLayer.svelte b/src/lib/components/viewer/RedactionLayer.svelte index ca9749109..d61e340be 100644 --- a/src/lib/components/viewer/RedactionLayer.svelte +++ b/src/lib/components/viewer/RedactionLayer.svelte @@ -28,13 +28,13 @@ So this layer is only showing unsaved redactions. export function clear() { redactions.set([]); + pending.set([]); }