From 7f3870a95b5f3937239f1c0d35c6f58835fd37bb Mon Sep 17 00:00:00 2001 From: igor Date: Sun, 14 Jun 2026 14:42:30 +0200 Subject: [PATCH] changed pooling interval from 3s to 10s --- public/js/wizard.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/public/js/wizard.js b/public/js/wizard.js index bfde63b..789358a 100644 --- a/public/js/wizard.js +++ b/public/js/wizard.js @@ -22,14 +22,14 @@ const App = { async init() { console.log('Initializing WebWizard...'); - + if (!this.state.userId) { await this.initSession(); } await this.loadCategories(); this.bindEvents(); - + // If we don't have a project, try to load existing or create one if (!this.state.project) { await this.loadLastProject(); @@ -70,14 +70,14 @@ const App = { syncSelectionWithProject() { if (this.state.project && this.state.project.wizard_data) { const wd = this.state.project.wizard_data; - + // Step 1 if (wd.business_category) { const bc = wd.business_category; this.state.selection.category = bc.group; this.state.selection.subcategory = bc.subcategory; this.state.selection.customDescription = bc.custom_description || ''; - + if (this.state.selection.category) { this.selectCategory(this.state.selection.category); this.state.selection.subcategory = bc.subcategory; @@ -136,7 +136,7 @@ const App = { if (m.contact_form) { document.getElementById('form-enabled').checked = m.contact_form.enabled; document.getElementById('form-config-container').classList.toggle('hidden', !m.contact_form.enabled); - + if (m.contact_form.mode) { document.querySelector(`input[name="form-mode"][value="${m.contact_form.mode}"]`).checked = true; document.getElementById('config-local').classList.toggle('hidden', m.contact_form.mode !== 'local'); @@ -224,7 +224,7 @@ const App = { bindEvents() { document.getElementById('btn-next').addEventListener('click', () => this.nextStep()); document.getElementById('btn-prev').addEventListener('click', () => this.prevStep()); - + document.getElementById('custom-description').addEventListener('input', (e) => { this.state.selection.customDescription = e.target.value; }); @@ -291,7 +291,7 @@ const App = { const card = document.createElement('div'); card.className = 'category-card'; if (this.state.selection.category === cat.id) card.classList.add('selected'); - + card.innerHTML = `
${icons[cat.id] || '📁'}
${cat.name}
@@ -305,13 +305,13 @@ const App = { selectCategory(categoryId) { this.state.selection.category = categoryId; this.state.selection.subcategory = null; - + this.renderCategories(); this.renderSubcategories(categoryId); this.renderSmartQuestions(categoryId); document.getElementById('subcategory-container').classList.remove('hidden'); - + if (categoryId === 'other') { document.getElementById('custom-category-group').classList.remove('hidden'); } else { @@ -345,7 +345,7 @@ const App = { const container = document.getElementById('services-list'); const itemDiv = document.createElement('div'); itemDiv.className = 'service-item'; - + itemDiv.innerHTML = `
Služba @@ -487,7 +487,7 @@ const App = { `; preview.classList.remove('hidden'); document.querySelector('#logo-upload-box .upload-placeholder').classList.add('hidden'); - + document.getElementById('btn-remove-logo').addEventListener('click', (e) => { e.stopPropagation(); this.removeAsset('logo'); @@ -502,12 +502,12 @@ const App = { item.className = 'gallery-item'; item.innerHTML = `Gallery ${index+1} `; - + item.querySelector('.btn-remove-asset').addEventListener('click', (e) => { e.stopPropagation(); this.removeAsset('gallery', index); }); - + container.appendChild(item); }); }, @@ -679,7 +679,7 @@ const App = { const formEnabled = document.getElementById('form-enabled').checked; const formMode = document.querySelector('input[name="form-mode"]:checked').value; - + const modulesData = { pages: ['home'], sections: sections, @@ -760,7 +760,7 @@ const App = { } catch (error) { console.error('Polling error:', error); } - }, 3000); + }, 10000); }, updateGenerationStatus(status) { @@ -786,7 +786,7 @@ const App = { const btnNext = document.getElementById('btn-next'); btnPrev.disabled = this.state.currentStep === 1; - + // Validation for Next button let nextDisabled = false; if (this.state.currentStep === 1) {