more fixes web + mobile
This commit is contained in:
@@ -33,6 +33,8 @@ const MUSIC_GENERATION_COIN_COST = 8;
|
||||
const CONFIRM_MODAL_MAX_WIDTH = 540;
|
||||
const FUNCTIONS_REGION = "europe-west1";
|
||||
const VOICE_SECTION_TITLES = ["BASE", "SENSIBILITÉ", "TECHNIQUE"];
|
||||
const FIRST_VOICE_STEP_INDEX = 1;
|
||||
const OPTIONAL_VOICE_CATEGORIES = new Set(["SENSIBILITÉ", "TECHNIQUE"]);
|
||||
|
||||
const ComposeSong = () => {
|
||||
const scrollRef = useRef(null);
|
||||
@@ -115,9 +117,18 @@ const ComposeSong = () => {
|
||||
if (selectedIndex === 0) {
|
||||
return Array.isArray(genres) && genres.length > 0;
|
||||
}
|
||||
if (selectedIndex === 1) {
|
||||
return !!(voice && typeof voice === "object" && voice.BASE);
|
||||
|
||||
const voiceStepIndex = selectedIndex - FIRST_VOICE_STEP_INDEX;
|
||||
const isVoiceStep =
|
||||
voiceStepIndex >= 0 && voiceStepIndex < VOICE_SECTION_TITLES.length;
|
||||
if (isVoiceStep) {
|
||||
const category = VOICE_SECTION_TITLES[voiceStepIndex];
|
||||
if (OPTIONAL_VOICE_CATEGORIES.has(category)) {
|
||||
return true;
|
||||
}
|
||||
return !!(voice && typeof voice === "object" && voice[category]);
|
||||
}
|
||||
|
||||
if (selectedIndex === instrumentStepIndex) {
|
||||
return Array.isArray(instruments) && instruments.length > 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user