Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions frontend/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function safeModeLabel(mode) {

// ── State ──
let currentMode = 'analyze';
let isAnalyzing = false;
let history = JSON.parse(localStorage.getItem('qyverix_history') || '[]');
let favorites = JSON.parse(localStorage.getItem('qyverix_favorites') || '[]');
let lastResult = '';
Expand Down Expand Up @@ -92,6 +93,9 @@ codeInput.addEventListener('keydown', (e) => {
}
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
e.preventDefault();
if (isAnalyzing) {
return;
}
runAnalysis();
}
});
Expand Down Expand Up @@ -372,12 +376,19 @@ checkConnection();

// ── Main Analysis ──
async function runAnalysis() {

if (isAnalyzing) {
return;
}

const code = sanitizeClientCode(codeInput.value.trim());
if (!code) {
showError('Please paste some code first.');
return;
}

isAnalyzing = true;

runBtn.disabled = true;
runBtn.classList.add('loading');
runLabel.textContent = '⟳ Analyzing...';
Expand Down Expand Up @@ -408,6 +419,7 @@ async function runAnalysis() {
statusDot.className = 'status-dot offline';
setEngineBadge('unknown');
} finally {
isAnalyzing = false;
runBtn.disabled = false;
runBtn.classList.remove('loading');
runLabel.textContent = '▶ Analyze Code';
Expand Down