Novo caminho no botao de back #6764

This commit is contained in:
Igor Licio 2025-10-24 12:47:40 -03:00
parent 358a50c70b
commit e1318a3d4e

View File

@ -1125,6 +1125,7 @@ const PDFViewerApplication = {
} }
this.pdfSaveCfazDialog?.setMessageContent('Arquivo enviado com sucesso.'); this.pdfSaveCfazDialog?.setMessageContent('Arquivo enviado com sucesso.');
window.pdfWasSaved = true;
} catch (reason) { } catch (reason) {
// When the PDF document isn't ready, or the PDF file is still // When the PDF document isn't ready, or the PDF file is still
// downloading, simply fallback to a "regular" download. // downloading, simply fallback to a "regular" download.
@ -1208,7 +1209,14 @@ const PDFViewerApplication = {
}, },
backButton() { backButton() {
backButton.disabled = true;
const requestId = document.getElementById('request_id')?.value;
if (window.pdfWasSaved) {
return window.location.href = `/requests/${requestId}`
} else {
window.history.back(); window.history.back();
backButton.disabled = false;
}
}, },
/** /**
* Report the error; used for errors affecting loading and/or parsing of * Report the error; used for errors affecting loading and/or parsing of