fix: single Synth button opens instrument modal, fix init race condition
- Remove small Synth button (already done earlier) - Large Synth button now calls openInstrumentSelector (instrument modal) - Fix _initPromise stale cache: reset to null when init fails - Module not loaded yet → retries on next select instead of stuck
This commit is contained in:
@@ -44,7 +44,11 @@
|
||||
if (_initialized && _synthInstance) return;
|
||||
if (_initPromise) return _initPromise;
|
||||
_initPromise = (async () => {
|
||||
if (!window.SpessaSynthClass || !window.__SpessaSynthCDN) return;
|
||||
if (!window.SpessaSynthClass || !window.__SpessaSynthCDN) {
|
||||
console.warn("[SonicSF] SpessaSynth CDN not available. Retrying on next select.");
|
||||
_initPromise = null;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (audioContext.state === 'suspended') await audioContext.resume();
|
||||
const procUrl = window.__SpessaSynthCDN + "spessasynth_processor.min.js";
|
||||
@@ -55,6 +59,7 @@
|
||||
_initialized = true;
|
||||
} catch (e) {
|
||||
console.warn("[SonicSF] SpessaSynth init failed:", e);
|
||||
_initPromise = null;
|
||||
}
|
||||
})();
|
||||
return _initPromise;
|
||||
|
||||
Reference in New Issue
Block a user