fix: immediately load ONLYOFFICE templates when page is already active after reload

This commit is contained in:
root
2026-07-16 12:07:53 +00:00
parent 8b9783060e
commit 63291169ba
4 changed files with 9 additions and 3 deletions

View File

@@ -6,6 +6,6 @@
"originalName": "master_cv_template.docx",
"path": "/root/workspace/cv-app/renderer/carbone-templates/433a0593-d3cf-414e-8763-ab5f87cbc75c.docx",
"uploadedAt": "2026-07-16T09:03:29.601Z",
"updatedAt": "2026-07-16T12:03:58.509Z"
"updatedAt": "2026-07-16T12:06:39.375Z"
}
]

View File

@@ -376,6 +376,12 @@ async function openOnlyofficeEditor(templateId, templateName) {
document.addEventListener('DOMContentLoaded', () => {
const templatesPage = document.getElementById('page-templates');
if (templatesPage) {
// Check on initial load (page may already be active from sessionStorage restore)
if (templatesPage.classList.contains('active')) {
checkOnlyofficeStatus();
loadOnlyofficeTemplates();
}
// Also watch for future tab switches
const observer = new MutationObserver(() => {
if (templatesPage.classList.contains('active')) {
checkOnlyofficeStatus();

View File

@@ -139,7 +139,7 @@
<!-- Modals -->
<div class="modal-overlay" id="modal-overlay"></div>
<script src="/static/app.js?v=7"></script>
<script src="/static/carbone.js?v=7"></script>
<script src="/static/app.js?v=8"></script>
<script src="/static/carbone.js?v=8"></script>
</body>
</html>