fix: bank indexing off-by-one — subtract 1 when sending bank to API
Client stores bank as b.number+1 (1-based) but the API expects 0-based bank numbers. Caused preset activation to load the wrong empty preset (bank 1 instead of bank 0), so blocks never appeared.
This commit is contained in:
+3
-3
@@ -649,7 +649,7 @@ export default function App(){
|
||||
const p=presets.find(pr=>pr.num===num);
|
||||
if(!p)return;
|
||||
setCurrentPreset(num);
|
||||
await handleLoadPreset(p.bank||1,num-1);
|
||||
await handleLoadPreset((p.bank||1)-1,num-1);
|
||||
},[presets,handleLoadPreset]);
|
||||
|
||||
// ── Blocks ──
|
||||
@@ -702,14 +702,14 @@ export default function App(){
|
||||
const next=Math.min(currentBank+1,8);
|
||||
setCurrentBank(next);
|
||||
const bp=presets.filter(p=>p.bank===next);
|
||||
if(bp.length>0)handleLoadPreset(bp[0].bank,bp[0].num-1);
|
||||
if(bp.length>0)handleLoadPreset(bp[0].bank-1,bp[0].num-1);
|
||||
},[currentBank,presets,handleLoadPreset]);
|
||||
|
||||
const handleBankDown=useCallback(()=>{
|
||||
const next=Math.max(currentBank-1,1);
|
||||
setCurrentBank(next);
|
||||
const bp=presets.filter(p=>p.bank===next);
|
||||
if(bp.length>0)handleLoadPreset(bp[0].bank,bp[0].num-1);
|
||||
if(bp.length>0)handleLoadPreset(bp[0].bank-1,bp[0].num-1);
|
||||
},[currentBank,presets,handleLoadPreset]);
|
||||
|
||||
const handleGlobalBypass=useCallback(()=>{
|
||||
|
||||
Reference in New Issue
Block a user