From e1318a3d4e2ba08a008d18f4578c2a51e4296276 Mon Sep 17 00:00:00 2001 From: Igor Licio Date: Fri, 24 Oct 2025 12:47:40 -0300 Subject: [PATCH] Novo caminho no botao de back #6764 --- web/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index e21e628ee..4745d32c0 100644 --- a/web/app.js +++ b/web/app.js @@ -1125,6 +1125,7 @@ const PDFViewerApplication = { } this.pdfSaveCfazDialog?.setMessageContent('Arquivo enviado com sucesso.'); + window.pdfWasSaved = true; } catch (reason) { // When the PDF document isn't ready, or the PDF file is still // downloading, simply fallback to a "regular" download. @@ -1208,7 +1209,14 @@ const PDFViewerApplication = { }, backButton() { - window.history.back(); + backButton.disabled = true; + const requestId = document.getElementById('request_id')?.value; + if (window.pdfWasSaved) { + return window.location.href = `/requests/${requestId}` + } else { + window.history.back(); + backButton.disabled = false; + } }, /** * Report the error; used for errors affecting loading and/or parsing of