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:
@@ -15888,7 +15888,7 @@ const App = () => {
|
|||||||
})), " FX: ", /*#__PURE__*/React.createElement("span", {
|
})), " FX: ", /*#__PURE__*/React.createElement("span", {
|
||||||
className: "text-zinc-500 font-normal"
|
className: "text-zinc-500 font-normal"
|
||||||
}, track.fxType || "None")), /*#__PURE__*/React.createElement("button", {
|
}, track.fxType || "None")), /*#__PURE__*/React.createElement("button", {
|
||||||
onClick: (e) => { e.stopPropagation(); const btn = e.currentTarget; setInstrumentDropdownTrackId(prev => prev === track.id ? null : track.id); setInstrumentDropdownBtnRect(btn.getBoundingClientRect()); setInstrumentSearchQuery(''); },
|
onClick: (e) => { e.stopPropagation(); openInstrumentSelector(track.id); },
|
||||||
className: "px-2.5 py-1 bg-zinc-800 hover:bg-zinc-700 text-amber-400 border border-amber-800 rounded text-xs font-bold flex items-center gap-1 max-w-[120px]"
|
className: "px-2.5 py-1 bg-zinc-800 hover:bg-zinc-700 text-amber-400 border border-amber-800 rounded text-xs font-bold flex items-center gap-1 max-w-[120px]"
|
||||||
}, /*#__PURE__*/React.createElement("span", {
|
}, /*#__PURE__*/React.createElement("span", {
|
||||||
className: "inline-flex items-center shrink-0"
|
className: "inline-flex items-center shrink-0"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -44,7 +44,11 @@
|
|||||||
if (_initialized && _synthInstance) return;
|
if (_initialized && _synthInstance) return;
|
||||||
if (_initPromise) return _initPromise;
|
if (_initPromise) return _initPromise;
|
||||||
_initPromise = (async () => {
|
_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 {
|
try {
|
||||||
if (audioContext.state === 'suspended') await audioContext.resume();
|
if (audioContext.state === 'suspended') await audioContext.resume();
|
||||||
const procUrl = window.__SpessaSynthCDN + "spessasynth_processor.min.js";
|
const procUrl = window.__SpessaSynthCDN + "spessasynth_processor.min.js";
|
||||||
@@ -55,6 +59,7 @@
|
|||||||
_initialized = true;
|
_initialized = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("[SonicSF] SpessaSynth init failed:", e);
|
console.warn("[SonicSF] SpessaSynth init failed:", e);
|
||||||
|
_initPromise = null;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
return _initPromise;
|
return _initPromise;
|
||||||
|
|||||||
Reference in New Issue
Block a user