From 1aa0237260122b0811d8646df2b409f01300d8e4 Mon Sep 17 00:00:00 2001 From: Ian Keane Date: Thu, 11 Jun 2026 12:59:04 -0400 Subject: [PATCH] Fix bug when only one result for call or learn --- app.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index d3359a5..32e2ac4 100644 --- a/app.js +++ b/app.js @@ -934,7 +934,9 @@ function openCallModal(mode) { callInstrumentId = null; callTuningId = null; renderCallStep(); - callModal.showModal(); + // showModal() is called inside renderCallStep() only when there are + // multiple options to show — if everything auto-skipped the modal + // never opens and the filter is applied instantly. } function renderCallStep() { @@ -942,13 +944,16 @@ function renderCallStep() { : callStep === 1 ? callGetTunings() : callGetKeys(); - // Skip this screen if there's only one option + // Auto-advance if only one option if (items.length === 1) { callSelect(callStep === 2 ? items[0].key : items[0].id, callStep === 2 ? items[0].modal : null); return; } + // Multiple options — open the modal now if not already open + if (!callModal.open) callModal.showModal(); + $('call-title').textContent = ['Instrument', 'Tuning', 'Key'][callStep]; $('call-back').hidden = callStep === 0; const opts = $('call-options');