Fix bug when only one result for call or learn
This commit is contained in:
parent
58c4dc08f3
commit
1aa0237260
1 changed files with 7 additions and 2 deletions
9
app.js
9
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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue