From 152cfc21fc4a4e221dec5f1ccb2698911f02cd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 29 Oct 2024 08:00:07 +0100 Subject: [PATCH] Show error when trying to open a shared PDF without download permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to show a PDF file it needs to be downloaded. Therefore, if a shared PDF file does not have download permissions it is not possible to show it, so now an error is shown instead. The error is a custom one rather than a standard error from the viewer (although with the same appearance) to better explain the reason. Note that the error is shown only when the PDF file is loaded through the viewer, which should be always the case. There is a fallback to inject the UI in public shares in case the viewer is not available, but handling the error also in that case was not trivial and that fallback should never be used anyway, so it was not taken into account. Signed-off-by: Daniel Calviño Sánchez --- src/views/PDFView.vue | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/views/PDFView.vue b/src/views/PDFView.vue index 9b3477c8..72f39e4a 100644 --- a/src/views/PDFView.vue +++ b/src/views/PDFView.vue @@ -3,9 +3,14 @@ - SPDX-License-Identifier: AGPL-3.0-or-later -->