changed pooling interval from 3s to 10s

This commit is contained in:
2026-06-14 14:42:30 +02:00
parent d07bc89eea
commit 7f3870a95b

View File

@ -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 = `
<div class="category-icon">${icons[cat.id] || '📁'}</div>
<div class="category-name">${cat.name}</div>
@ -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 = `
<div class="service-item-header">
<span class="service-number">Služba</span>
@ -487,7 +487,7 @@ const App = {
<button class="btn-remove-asset" id="btn-remove-logo">×</button>`;
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 = `<img src="/${path}" alt="Gallery ${index+1}">
<button class="btn-remove-asset" data-index="${index}">×</button>`;
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) {